Repository navigation
fix: normalize island CSS paths for Windows compatibility - #69
Merged
Brooooooklyn merged 1 commit intoApr 2, 2026
Merged
Brooooooklyn merged 1 commit into
Brooooooklyn merged 1 commit into
Conversation
shulaoda
force-pushed
the
04-02-fix_normalize_island_css_paths_for_windows_compatibility
branch
from
April 2, 2026 14:55
cdd0599 to
ce30d03
Compare
shulaoda
force-pushed
the
04-02-fix_normalize_island_css_paths_for_windows_compatibility
branch
from
April 2, 2026 14:56
ce30d03 to
c3d573c
Compare
There was a problem hiding this comment.
Pull request overview
Fixes Windows dev-server 404s for island/layout CSS by ensuring Vite module IDs and internal lookup keys use consistent forward-slash paths.
Changes:
- Normalize stored island/layout file paths via
normalizePath()when populatingislandCssFiles(Vue/React/Solid/Svelte). - Normalize
.cssvirtual module resolution inputs inresolveIdto ensureislandCssFiles.has()lookups work on Windows. - Normalize paths used by the dev server middleware + file watcher invalidation in
configureIslandCssServer(void core).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/vue/src/plugin-islands.ts | Normalizes island/layout CSS file paths and resolveId lookup keys for Windows-safe matching. |
| packages/react/src/plugin-islands.ts | Same normalization strategy as Vue for island/layout CSS resolution. |
| packages/solid/src/plugin-islands.ts | Same normalization strategy as Vue for island/layout CSS resolution. |
| packages/svelte/src/plugin-islands.ts | Same normalization strategy as Vue for island/layout CSS resolution. |
| packages/void/src/pages/islands-plugin.ts | Normalizes watcher and middleware paths before islandCssFiles lookups and module invalidation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Brooooooklyn
deleted the
04-02-fix_normalize_island_css_paths_for_windows_compatibility
branch
April 2, 2026 15:06
cpojer
pushed a commit
that referenced
this pull request
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix island CSS serving broken on Windows during dev. Layout
<style>blocks in island pages (including.mdpages) returned 404 because of path separator mismatches (\vs/).Problem
On Windows,
path.resolve()produces backslash paths (e.g.E:\foo\pages\layout.vue), but Vite internally normalizes all module IDs to forward slashes. This caused two failures in the island CSS pipeline:islandCssFilesstored backslash paths — populated viaresolve(pagesDir, layout.filePath)which returns\-separated paths on Windows.loadhook received forward-slash IDs — whenresolveIdreturned a backslash path likeE:\foo\layout.vue.css, Vite normalized it toE:/foo/layout.vue.cssbefore passing toload. TheislandCssFiles.has()check then failed, causingtransformRequestto throwERR_LOAD_URL, which was silently caught, resulting in a 404.The same mismatch affected the dev server middleware (
configureIslandCssServer) and the file watcher callback.Fix
Apply
normalizePath()(from Vite) consistently to ensure all paths stored inislandCssFilesand all paths used for lookups use forward slashes:packages/void/src/pages/islands-plugin.ts— normalize paths inconfigureIslandCssServer(middleware resolve + watcher callback)packages/vue/src/plugin-islands.ts— normalize when populatingislandCssFilesand inresolveIdhookpackages/react/src/plugin-islands.ts— same changes as vuepackages/solid/src/plugin-islands.ts— same changes as vuepackages/svelte/src/plugin-islands.ts— same changes as vue