Skip to content

Normalize lazy-ref src values - #7

Open
Mersho wants to merge 2 commits into
solidjs:mainfrom
Mersho:fix/windows-backslash
Open

Normalize lazy-ref src values#7
Mersho wants to merge 2 commits into
solidjs:mainfrom
Mersho:fix/windows-backslash

Conversation

@Mersho

@Mersho Mersho commented Aug 26, 2026

Copy link
Copy Markdown

Fixes #6

Mersho added 2 commits August 26, 2026 08:19
On Windows OS, node:path relative() returns backslashed src values
in serialized lazy refs. Vite client-manifest keys are always posix,
so they never match: SSR hydration preloads silently miss and SolidJS
server lazy() breaks. The test fails on Windows today and pins the
invariant before the fix lands.
node:path relative() emits Windows separators, which never match
Vite's always-posix client-manifest keys — SSR hydration preloads
miss and server lazy() breaks. Every other path in the pipeline is
already normalized through normalizePath(); these two sites were the
only ones missed. Turns the regression test from the previous commit
green on Windows.
Comment thread test/vite.spec.ts
expect(code.match(/pick=default&pick=\$css&lang\.tsx'\)/g)?.length).toBe(2);
});

it("serializes lazy-ref src values with forward slashes", async () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually test something with forward slashes or am i missing something

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.

Serialized lazy-ref src values contain backslashes

2 participants