-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Nitro does not respect module path (e.g. in monorepo) with target: server #11465
Copy link
Copy link
Closed
Description
Hey all!
When using Nitro with target: server and a monorepo (see repo structure), the Nitro output does not include the correct path to the deps (e.g. un fetch polyfill)
Repro
- Install deps
yarn - Build app
yarn build - Check
packages/app/.output/server/index.js. Here, the path is set correct (../../../../node_modules/@nuxt/un/runtime/polyfill/fetch.node.jsin our case) - Now check
packages/app/.output/server/nitro/server.js. The path incorrect here - Same for
packages/app/.output/server/nitro/chunks/app/render.js
Expected path: require('../../../../../node_modules/@nuxt/un/runtime/polyfill/fetch.node.js');
Actual path: require('../../../../node_modules/@nuxt/un/runtime/polyfill/fetch.node.js');
When fixing the paths manually, the app runs as expected
Workaround?
Using nohoist for the packages might work.
Reactions are currently unavailable