Skip to content

fix(plugins): normalize relativePath separators for Windows - #827

Open
cy7372 wants to merge 1 commit into
agegr:mainfrom
cy7372:fix/plugins-route-relative-path-windows
Open

cy7372 wants to merge 1 commit into
agegr:mainfrom
cy7372:fix/plugins-route-relative-path-windows

Conversation

@cy7372

@cy7372 cy7372 commented Sep 13, 2026

Copy link
Copy Markdown

Node's path.relative() returns backslashes on Windows, so the plugins API leaked platform-specific separators into relativePath — the bundled route test (app/api/plugins/route.test.mjs) asserts extensions/rtk.ts and fails on Windows.

-  return rel && !rel.startsWith(..) ? rel : resource.path;
+  return rel && !rel.startsWith(..) ? rel.split(sep).join(/) : resource.path;

The test now passes on Windows; no behavior change on POSIX (sep is / there).

Node's path.relative() returns backslashes on Windows, so the plugins
API leaked platform-specific separators into relativePath (the bundled
route test asserts 'extensions/rtk.ts' and fails on Windows). Normalize
with sep-split before returning.
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