Skip to content

fix: build node_modules paths with the platform separator - #610

Open
oldium wants to merge 1 commit into
vercel:mainfrom
oldium:fix/oj-scoped-symlink-path
Open

oldium wants to merge 1 commit into
vercel:mainfrom
oldium:fix/oj-scoped-symlink-path

Conversation

@oldium

@oldium oldium commented Aug 30, 2026

Copy link
Copy Markdown

Package specifiers always use /, so concatenating a scoped name or an exports target into a path yields …\node_modules\@scope/pkg on Windows. Comparisons against a sep-joined prefix — inPath() while walking symlinks — then fail, and the node_modules symlink of a scoped package is never emitted, leaving a standalone deployment without it.

Only CommonJS was unaffected, because resolveDir() happens to pass its paths through resolve(); the ESM branch of validateAndResolvePaths() keeps them verbatim. Translate separators where a specifier becomes a path instead.

Package specifiers always use `/`, so concatenating a scoped name or an
`exports` target into a path yields `…\node_modules\@scope/pkg` on
Windows. Comparisons against a sep-joined prefix — `inPath()` while
walking symlinks — then fail, and the `node_modules` symlink of a scoped
package is never emitted, leaving a standalone deployment without it.

Only CommonJS was unaffected, because `resolveDir()` happens to pass its
paths through `resolve()`; the ESM branch of `validateAndResolvePaths()`
keeps them verbatim. Translate separators where a specifier becomes a
path instead.

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
@oldium
oldium requested review from a team, icyJoseph, ijjk and styfle as code owners August 30, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant