Nuxt.js: Cannot find module 'pages/index.js?v=d187aabeaedb9b4063f6' from '/sandbox'

Created on 11 Feb 2019  路  26Comments  路  Source: nuxt/nuxt.js

Version

v2.4.3

Reproduction link

https://codesandbox.io/s/ov642w2v25?module=%2Fnuxt.config.js

Steps to reproduce

Make chunkName as '[name].js?v=[contenthash]' in nuxt.config.js

What is expected ?

There is no error

What is actually happening?

Error page with NuxtServerError
Cannot find module 'pages/index.js?v=d187aabeaedb9b4063f6' from '/sandbox'

Additional comments?

PR https://github.com/nuxt/nuxt.js/pull/4439 make code simplier:
it was before:

bundle.files[asset.name] = compilation.assets[asset.name].source()

and after:

bundle.files[asset.name] = asset.name

I'am not sure is this line works early, but now it don't.
Created .nuxt/dist/server/server.manifest.json contains:

{
  "entry": "server.js",
  "files": {
    "pages/index.js?v=825661537585209d20c2": "pages/index.js?v=825661537585209d20c2",
    "server.js": "server.js"
  },
  "maps": {
    "server.js": "server.js.map"
  }
}

Obviously, there is no that file.

This bug report is available on Nuxt community (#c8640)
bug-report pending

All 26 comments

This is an issue in the initial scaffolding of create-nuxt-app. Rolling nuxt back to 2.4.2 fixes this for now

@DaleMatthews Could you please provide more details about how to reproduce?

I've just tried generating nuxt apps with various parameters and can't seem to recreate this issue again

Because it's happens randomly. I have this issue in all current Nuxt projects, after I update my package.json. https://cmty.app/nuxt/nuxt.js/issues/c8631#comment-5c66695539ee380014b5037b

I need to manually restart dev server to fix this. I have to do this literally hundreds of times per day.

@bdrtsky feel free to send in a bug report

@clarkdo Running nuxt-edge solved the issue for me for now, so I'm guessing it's been fixed recently.

@manniL happy to do this, but I am not sure how to reproduce this. It doesn't happens every time, may be once in 10-30 dev server reloading. Still no see any pattern there.

@bdrtsky Include as much info as you can. If you can't repro that reliably, state it as is 鈽猴笍

Having a similar issues as well with just pages/index.js. The only potential issue I see is that I have srcDir set in my nuxt config and maybe sometimes that not read.

This is an issue in the initial scaffolding of create-nuxt-app. Rolling nuxt back to 2.4.2 fixes this for now

@DaleMatthews do you know what is causing the problem in the scaffolding and how to fix it? I have an app generated with 2.4.3, just yarn upgraded to 2.4.5 but still have the issue.

Have the same issue on 2.4.3 and 2.4.5 versions.
2.4.2 is ok.

@arkhamvm the fix has already been rolled out 馃 via #5007

@manniL actually I'm experimenting the problem without using chunking. I just get
_Cannot find module 'pages/index.js'_ (and for every other route). Then I stop the server, run dev again and if I'm lucky I can start working again. It happens totally random, so I don't really know where to look at

@manniL actually I'm experimenting the problem without using chunking. I just get
_Cannot find module 'pages/index.js'_ (and for every other route). Then I stop the server, run dev again and if I'm lucky I can start working again. It happens totally random, so I don't really know where to look at

Yeah, absolutely similar

@mfrascati @arkhamvm That's a completely different issue. Please create a new bug report.

@manniL @clarkdo I can aprove - bug still present, there is no PR in 2.4.5

It seemed that this pr isn鈥檛 included in latest release @manniL @pi0

@clarkdo Whoops.

@mfrascati you just described my problem exactly. Did you managed to create separate issue?

@bdrtsky Opened an issue here: https://github.com/nuxt/nuxt.js/issues/5132

I was just able to delete my node_modules directory and re-run install and it started to work. Im guessing it's because my npm package updated.

It seemed that this pr isn鈥檛 included in latest release @manniL @pi0 @clarkdo

Guys, when release is planned?

@karakum This week 馃槃

I faced the same issue yesterday and today.
This issue appears to me randomly.

Same problem here and yes, it seems random. Not sure how to fix it

@codeofsumit With the ?v=... suffix or more like https://github.com/nuxt/nuxt.js/issues/5132 ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vadimsg picture vadimsg  路  3Comments

danieloprado picture danieloprado  路  3Comments

vadimsg picture vadimsg  路  3Comments

pehbehbeh picture pehbehbeh  路  3Comments

surmon-china picture surmon-china  路  3Comments