-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual CSS modules #479
Comments
Requesting to reopen: I updated to the latest version of vike and have resolve problems in dev mode: In dev mode I get this html served, where you can see alot of Those can all not be resolved and end up in a 404 (screenshot 2). Later on the assets are properly loaded using the correct URL (screenshot 3). The URLS differe like this:
According to this https://vitejs.dev/guide/api-plugin.html#virtual-modules-convention this seems to be a virtual plugin transformation. I am using This only is happening in dev mode (using vite middleware). A repro can be found here https://github.com/IT4Change/boilerplate-frontend/ (commit This seems to be the right issue describing the problem: #479 Any hint how to solve this? ❤️ |
A fix, which might not be the best way to solve things, but works on my machine:
I added the This is in the file In the sources it would be: https://github.com/vikejs/vike/blob/main/vike/node/runtime/renderPage/getPageAssets/retrieveAssetsDev.ts#L49 To do it properly you can use https://github.com/vitejs/vite/blob/56ae92c33cba6c86ab5819877c19b9ea39f7121b/packages/vite/src/node/constants.ts#L78 |
3d25618 pre-released in |
Works like a charm @brillout - no more errors with release Tho I would suggest a code change to match the code at vite - see here for reference styleUrls.add(`/@id/${mod.url.replace('\0','__x00__')}`) Consider to explain VITE_NULL_BYTE_PLACEHOLDER = '__x00__'
...
styleUrls.add(`/@id/${mod.url.replace('\0',VITE_NULL_BYTE_PLACEHOLDER)}`) Why is this important? As far as I read the code at vite it would replace any occurrence of the \0 character not only the first. |
Vite does The fix adds a link to your comment, I think it's good enough. Thanks for the bug report and digging into a fix. In case your compnay is up for it: Sponsor Vike. |
Description
From discord:
Error Stack
No response
The text was updated successfully, but these errors were encountered: