-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[Vite plugin]: assets only imported in resource routes not included in build output #7847
Comments
It seems vite now provides Further context on sveltekit:
|
@hi-ogawa, thanks for this information! I've just tried it, indeed it now generates the assets but in the server build folder instead of the public one. Consequently, it's still produces 404s in the browser :-/ |
@manzano78 Thanks for experimenting it. Indeed, just setting the option in the user config alone is not a complete solution. Looking at svelte's case sveltejs/kit#9073, what they ended up doing is to simply copy over all "server" assets to "client" assets. cp -f build/assets/* public/build/assets then this can be simply chained together in "build": "vite build && vite build --ssr && cp -f build/assets/* public/build/assets" |
@hi-ogawa thank you very much for your help, I appreciate! This solution seems okay for the production build but I think it can't work in development mode with HMR and HDR, can it? |
FYI, I'm attempting a fix in #7892, which mostly does the same thing as
I don't think this specific issues are relevant for But, looking at your case, the usage of |
This is fixed by #7892. Since you're using |
@markdalgleish, despite the latest version of Vite (v5.1.1), the latest Remix nightly (v0.0.0-nightly-4111fd1-20240210) and |
What version of Remix are you using?
v0.0.0-nightly-99a8d9c-20231031
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
Exactly the same issue than this one with the current compiler : #3414
The issue also occurs on normal UI routes when the URL is only used in the loader, server side.
npm run build
Expected Behavior
I would expect the asset to be included in the build output
Actual Behavior
The asset is not included in the build output
The text was updated successfully, but these errors were encountered: