[next-rspack] NextExternalsPlugin wrongly externalizes transpilePackages direct dependencies on Windows + pnpm (dev only, pages router)
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
Link to the code that reproduces this issue
https://github.com/helloworldcyj/rspack-next-externals-repro
To Reproduce
One-time setup: generates vendor/demo-service-1.0.0.tgz from packages/service
(the tarball is NOT committed to git), then installs dependencies
pnpm bootstrap
① rspack dev (bug scene)
pnpm repro:rspack
Open http://localhost:3100
The page shows: SSR resolve result: FAILED: No matching bindings found for serviceIdentifier: Symbol(Config)
② webpack dev (control group, behaves correctly)
pnpm repro:webpack
The page shows: SSR resolve result: OK, answer = 42
③ rspack production build (also works fine, which shows the issue is dev-mode specific)
pnpm build:rspack
Current vs. Expected behavior
Environment: Windows + pnpm (junctions inside node_modules) + Next.js 16.3.0 + next-rspack 16.3.0 (NEXT_RSPACK=true) + pages router
Expected: both transpile packages are bundled into the pages router server bundle (this is what happens in webpack mode)
Provide environment information
Environment: Windows + pnpm (junctions inside node_modules) + Next.js 16.3.0 + next-rspack 16.3.0 (NEXT_RSPACK=true) + pages router
Which area(s) are affected? (Select all that apply)
Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
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 rspack-next-externals-repro repository and run pnpm bootstrap followed by pnpm repro:rspack on Windows. Compare the failing pages-router SSR result with pnpm repro:webpack and pnpm build:rspack, then trace how NextExternalsPlugin handles transpilePackages in rspack dev mode. Done means both transpile packages are bundled and the page reports the expected answer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js, webpack
- Domain
- backend, build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100