Skip to content

fix: use root-relative URLs for in-project client component modules in dev#337

Merged
lazarv merged 1 commit intomainfrom
fix/module-loader
Mar 5, 2026
Merged

fix: use root-relative URLs for in-project client component modules in dev#337
lazarv merged 1 commit intomainfrom
fix/module-loader

Conversation

@lazarv
Copy link
Owner

@lazarv lazarv commented Mar 5, 2026

In dev mode, client component modules were always loaded via /@fs/<cwd>/... URLs (both in __webpack_require__ and <link rel="modulepreload">). However, Vite's module graph normalizes in-project files to root-relative URLs (e.g., /app/providers.jsx). This URL mismatch caused the browser to load the same module twice, once at /@fs/... and again at the root-relative path with a ?t= cache-bust timestamp from Vite's HMR/dep optimization.

@lazarv lazarv merged commit d311e2f into main Mar 5, 2026
99 of 100 checks passed
@lazarv lazarv deleted the fix/module-loader branch March 5, 2026 20:38
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