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

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.

<div align="right">This bug report is available on Nuxt community (#c8640)</div>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 7
  • Comments: 26 (9 by maintainers)

Most upvoted comments

@clarkdo Whoops.

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.