Windows - Next.js standalone output (pnpm) may contain symlinks resolving outside `.next/standalone`
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.5k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 334
Description
Link to the code that reproduces this issue
https://github.com/timheerwagen/next-standalone-pnpm-symlink-repro
To Reproduce
pnpm install
pnpm build
pnpm test - The script shows the resolved path of the standalone Next Node module.
Current vs. Expected behavior
When using Next.js with output: "standalone" together with pnpm, the generated standalone output contains symlinks inside .next/standalone/node_modules that resolve to the root node_modules/.pnpm dir instead of the .next/standalone/node_modules/.pnpm directory.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home
Available memory (MB): 16294
Available CPU cores: 12
Binaries:
Node: 24.11.1
npm: 11.16.0
Yarn: N/A
pnpm: 10.23.0
Relevant Packages:
next: 16.2.10 // Latest available version is detected (16.2.10).
eslint-config-next: N/A
react: 19.2.7
react-dom: 19.2.7
typescript: N/A
Next.js Config:
output: standalone
Which area(s) are affected? (Select all that apply)
Module Resolution
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
This behaviour only occurs on Windows and not on Linux, as demonstrated here: https://github.com/timheerwagen/next-standalone-pnpm-symlink-repro/actions/runs/28657904104/job/84991341147.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked next-standalone-pnpm-symlink-repro repository and run pnpm install, pnpm build, and pnpm test on Windows. Trace the standalone output produced by next build and compare the resolved paths under .next/standalone/node_modules with the Linux behavior described in the issue. Done means the generated symlinks resolve within .next/standalone/node_modules/.pnpm on Windows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nextjs, node.js
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100