question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot preview after nuxt build

See original GitHub issue

I 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:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
Diizzayycommented, Jul 8, 2022

@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.

3reactions
mateuszkulpacommented, Sep 16, 2022

Hello, I found an alternative workaround for this issue. After build, you should use --experimental-specifier-resolution=node flag to start your app.

node --es-module-specifier-resolution=node .output/server/index.mjs

I believe this issue is caused by import of graphql/language/parser without .mjs extension in output chunks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

nuxt.js - Not able to preview NuxtJs3 build
My Nuxt 3 Project is suddenly giving me some error after release of 3.0.0-rc.5, it used to work well and now i am...
Read more >
Cannot get Previews to work with SPA app · Issue #114
I've been trying to figure out how to get Preview functionality to work with my SPA app for the longest time. Does anyone...
Read more >
How to Implement Previews with Nuxt Applications using a ...
In this step by step beginners tutorial, you'll learn how to integrate Nuxt Previews using Strapi as the backend to preview content before ......
Read more >
Unpublished posts cannot be previewd with Nuxt.js
Check in the head of all your pages to make sure the script is present, make sure that the Prismic preview toolbar script...
Read more >
Commands and Deployment
nuxt start - Start the production server (after running nuxt build ). Use it for Node.js hosting like Heroku, Digital Ocean, etc. target:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found