You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to migrate https://kentcdodds.com (currently on the Remix compiler) to use the unstable Remix Vite plugin. Everything's working except for the .css?url import. It appears to be that the files are getting built and I'm getting a path as the default import value, however the built file and the path do not match.
Ultimately this means that the browser is looking for /assets/vendors-HTcLOMO0.css but the file is actually accessible at /assets/vendors-S_1f6r_V.css.
Things are working ok during development, but not with the production build (both locally and deployed). You'll find the deployed version here: https://kcd-staging.fly.dev/
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
It seems there are two CSS files generated from the same CSS file. One by the client build (e.g. /build/client/vendors-S_1f6r_V.css) and one by the server build (e.g. /build/server/assets/vendors-HTcLOMO0.css). Because the server request the CSS file with the generated filename by server build and the client build has a different filename for the same CSS file, the request gets 404.
The file name was different because the file content was different. That was happening because Vite sets build.minify: false for SSR (
Closing as this is working as intended.
I do think Vite should default that to true in SSR but that's a breaking change and we'll need to wait for Vite 6 (#15637).
For now, I think setting cssMinify: true on remix side would be nice.
Describe the bug
I'm trying to migrate https://kentcdodds.com (currently on the Remix compiler) to use the unstable Remix Vite plugin. Everything's working except for the
.css?url
import. It appears to be that the files are getting built and I'm getting a path as the default import value, however the built file and the path do not match.Ultimately this means that the browser is looking for
/assets/vendors-HTcLOMO0.css
but the file is actually accessible at/assets/vendors-S_1f6r_V.css
.Things are working ok during development, but not with the production build (both locally and deployed). You'll find the deployed version here: https://kcd-staging.fly.dev/
Reproduction
https://github.com/kentcdodds/kentcdodds.com
Steps to reproduce
Open http://localhost:3000 and you'll get 404s for assets. Check
build/client/assets
and you'll find the assets for CSS have a different fingerprint.System Info
Used Package Manager
npm
Logs
N/A
Validations
The text was updated successfully, but these errors were encountered: