-
Notifications
You must be signed in to change notification settings - Fork 28k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PNPM Workspaces + Standalone cannot find module get-network-host upon launch #77472
Comments
Hello! This seems to be a #48017 replica. |
@HenriqueSenaDev Indeed, the node_modules directory becomes yarn-like flat and pnpm doesn't even create This leads to |
Same problem here, did you find any workaround about it in the meantime? |
Is everyone running into this using Next.js 15? If so, did it work correctly in Next.js 14? We're trying to deploy our Next.js 15 upgrade and right off the bat, we can see that the structure of the |
@subvertallchris @flaviodelgrosso I think it's a minor quirk compared to a completely malfunctioning app 😄 |
Link to the code that reproduces this issue
https://github.com/eddienubes/next-pnpm-standalone-bug-repro/tree/main
To Reproduce
Preliminary actions
Standard monorepo setup, where one of the projects is next.js.
Error:
Error: Cannot find module '../../lib/get-network-host'
Current vs. Expected behavior
ER:
Standalone server successfully launches
AR:
Server.js inside standalone folder fails to locate a module ../../lib/get-network-host
with error:
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:22 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6041 Available memory (MB): 24576 Available CPU cores: 12 Binaries: Node: 22.13.1 npm: 10.9.2 Yarn: N/A pnpm: 10.6.1 Relevant Packages: next: 15.2.3 // Latest available version is detected (15.2.3). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.8.2 Next.js Config: output: standalone
Which area(s) are affected? (Select all that apply)
Output
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
Upon further inspection I noticed that after
pnpm install
and beforepnpm build
(next build), theprojects/ui/node_modules
doesn't have.pnpm
folder. Theprojects/ui/node_modules
as expected contains symlinks to the rootnode_modules/.pnpm
with next, react and react-dom packages.However, after I run
next build
the contents ofprojects/ui/node_modules
is modified and the.pnpm
folder appears with:[email protected][email protected][email protected][email protected][email protected]
[email protected][email protected]
The tree looks:
Almost the same contents appear in the standalone bundle itself:
So, there's clearly nothing that can resolve to
../../lib/get-network-host
.For some reason the bundle next dist directory is truncated.
The text was updated successfully, but these errors were encountered: