Skip to content
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

Fix dest already exists build errors #9901

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

markdalgleish
Copy link
Member

Fixes #9498.

This fix was inspired by #9800, but I decided to make this more error-proof by inspecting files on disk rather than inspecting the Vite manifest files/assets and potentially getting it wrong (as we have already).

Copy link

changeset-bot bot commented Aug 22, 2024

🦋 Changeset detected

Latest commit: 2566e2d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/css-bundle Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

let dest = path.join(clientBuildDirectory, ssrAssetPath);
let dest = path.join(clientBuildDirectory, ssrAssetPath);

if (!fse.existsSync(dest)) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since (assuming no errors) we were guaranteed to either move the SSR asset or delete it depending on whether it's present in the client assets, it's much safer to use the file system as the source of truth rather than trying to infer what's on disk based on the Vite manifest.

@markdalgleish markdalgleish merged commit c5292ed into dev Aug 22, 2024
9 checks passed
@markdalgleish markdalgleish deleted the markdalgleish/fix-ssr-assets branch August 22, 2024 03:28
@github-actions github-actions bot added the awaiting release This issue has been fixed and will be released soon label Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release This issue has been fixed and will be released soon CLA Signed package:dev vite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant