unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

`lexical` node-specific package is not traced correctly #2562

Open manniL opened 3 months ago

manniL commented 3 months ago

Environment

Stackblitz

Reproduction

  1. Open the StackBlitz
  2. Run pnpm build
  3. Start the server
  4. See the error

To "fix"

  1. Uncomment the line in the nitro config which traces the package manually
  2. Rebuild and restart

Describe the bug

When using lexical, Nitro does not include the node-specific package (Lexical.node.mjs in the final artifact. This leads to the following error in prod: Cannot find module '/home/projects/github-br8xh5/.output/server/node_modules/lexical/Lexical.node.mjs' imported from /home/projects/github-br8xh5/.output/server/chunks/routes/index.mjs

Additional context

Originally reported in https://github.com/nuxt/nuxt/issues/27784

Logs

No response