Cannot preview after nuxt build
See original GitHub issueI get this error when trying to run the bundled nuxt app
[nuxt] [request error] Cannot find module '[mypath]\Frontend\.output\server\node_modules\graphql\language\parser' imported from [mypath]\Frontend\.output\server\chunks\server.mjsDid you mean to import graphql/language/parser.js? at new NodeError (node:internal/errors:372:5) at finalizeResolution (node:internal/modules/esm/resolve:437:11) at moduleResolve (node:internal/modules/esm/resolve:1009:10) at defaultResolve (node:internal/modules/esm/resolve:1218:11) at ESMLoader.resolve (node:internal/modules/esm/loader:580:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:294:18) at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:80:40) at link (node:internal/modules/esm/module_job:78:36)
I did follow the Quick start guide, yarn dev works fine the preview throws the error above
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top GitHub Comments
@krank56 @denis-gorin Thank you for raising this issue and providing the relevant details.
This appears to be an upstream bug with the nuxt 3 production server bundle on windows. We’re looking into it and will address this as soon as possible.
Hello, I found an alternative workaround for this issue. After build, you should use
--experimental-specifier-resolution=node
flag to start your app.I believe this issue is caused by import of
graphql/language/parser
without.mjs
extension in output chunks.