-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 | Build | Client/SSR Duplicate Asset Error #9239
Vite | Build | Client/SSR Duplicate Asset Error #9239
Conversation
|
Welcome, and thank you for contributing to Remix! Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once. You may review the CLA and sign it by adding your name to contributors.yml. Once the CLA is signed, the If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run. Thanks! - The Remix team |
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
If our logic is correct you shouldn't be seeing this error. Would you be able to share a minimal reproduction? |
Thanks for the quick response @markdalgleish. Yes - let me do a little more digging and whip something up. |
okay - @markdalgleish I added you to a stackblitz project with version of my branch where I am able to reproduce the error. https://stackblitz.com/edit/vitejs-vite-wdeefj Dev will build and run but Reproduction Steps
|
@markdalgleish Ping to see if there are any updates. |
@PrescottJRynewicz Thanks for providing a repro. I was able to work out the root cause of this issue and fix it here: #9305 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this issue and for the PR! I'm closing this in favour of #9305 which has now been merged.
Description
When migrating from esbuild to Vite, I encountered a small issue when creating the Vite production builds. Even though dev was working as expected, there was an error during the
writeBundle
step of the SSR build.After debugging locally, I found a quick check that should resolve the issue I was facing.
Expected Behavior
Vite builds for production once the development server is working.
Actual Behavior
The client bundle builds appropriately, but the SSR bundle fails with this error
This error was thrown on
writeBundle
step, when a server asset was trying to be moved to the client asset directory, even though the client asset already existed.Root Cause
This could also mean there is an issue with the
getViteManifestAssetPaths
or theclientViteManifest
, because the manifest doesn't appear to have all the assets listed that actually exist in the assets folder.Testing
I didn't see any tests for the
plugin
file, so I didn't include any here. This is also a two line change