Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: node_modules paths in runtime configuration payload #3022

Open
dargmuesli opened this issue Jul 10, 2024 · 1 comment
Open

fix: node_modules paths in runtime configuration payload #3022

dargmuesli opened this issue Jul 10, 2024 · 1 comment
Labels
🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing v8 v9

Comments

@dargmuesli
Copy link
Collaborator

dargmuesli commented Jul 10, 2024

Environment

Reproduction

will submit if necessary

Describe the bug

The Google search console shows countless "Not found (404)" errors to me for paths to language files that are not available in a production build, i.e. paths to files inside node_modules:

image

You can check out my website's source code and search for node_modules. You'll see that those paths:

window.__NUXT__.config={
 "public": {
   "i18n": {
     "configLocales": [
       {
         "code": "en",
         "name": "English",
         "iso": "en",
         "files": [
           "../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]__onw6a5qdvo7xolh5mymdy7mkeu/node_modules/@dargmuesli/nuxt-vio/locales/en.json",
           "locales/en.json"
         ]
       },
     ],
...

@dargmuesli/nuxt-vio being a layer of mine.

Apparently Google picks those paths up, but I guess they are of no use here as node_modules shouldn't be available in a project built for production, right?

Any reason to keep these paths here? Should they be corrected maybe or removed?
I hope this report helps, would love to assist!

Additional context

I wonder why those paths are picked up, as I don't see any network request being tried to those paths.

Logs

No response

@BobbieGoede
Copy link
Collaborator

Hmm I guess Google tries to crawl anything that resembles a link 🤔 Did not think they would also try paths in javascript variables 😂

It's worth looking into removing these paths from production builds as long as these are not used after build.

@BobbieGoede BobbieGoede added v8 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing v9 and removed pending triage labels Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing v8 v9
Projects
None yet
Development

No branches or pull requests

2 participants