Skip to content

[next-rspack] NextExternalsPlugin wrongly externalizes transpilePackages direct dependencies on Windows + pnpm (dev only, pages router) #98505

Description

@helloworldcyj

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RuntimeRelated to Node.js or Edge Runtime with Next.js.

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions