Rollup (via Node's readFile) will then try to open this file with the given relative path. Using yarn and nodeLinker: pnpm will not place the actual file in the same node_modules folder but instead in the top-level one.
Maybe nitropack should resolve these dependencies using import.meta.resolve or require.resolve instead of letting rollup resolve it relative to the package to be bundled.
Environment
Nitro: 2.9.7 Node: 20.15.1
Reproduction
Build nitro app using
yarn
andnodeLinker: pnpm
Describe the bug
When building my app, the
import '#internal/nitro/virtual/polyfill'
statement will try to set somealias
es, e.g. https://github.com/unjs/nitro/blob/eaffb9a62ca3aec702c11c6a5373a39882652a05/src/core/config/resolvers/fetch.ts#L16Rollup (via Node's readFile) will then try to open this file with the given relative path. Using
yarn
andnodeLinker: pnpm
will not place the actual file in the samenode_modules
folder but instead in the top-level one.Maybe
nitropack
should resolve these dependencies usingimport.meta.resolve
orrequire.resolve
instead of letting rollup resolve it relative to the package to be bundled.Additional context
No response
Logs
No response