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(dev): prevent rebuilds from hanging #6295

Merged
merged 2 commits into from
May 3, 2023
Merged

Conversation

pcattori
Copy link
Contributor

@pcattori pcattori commented May 3, 2023

Fixes #6285

by canceling the previous build when a new rebuild is kicked off

Testing Strategy:

Tested locally by hitting Cmd + S quickly and repeatedly with the Remix App Server template with unstable_dev: true set. Hangs in 1.16, but continues to rebuild correctly with these changes.

TODO

  • Do not log ugly cancelation "error"

by canceling the previous build when a new rebuild is kicked off
@changeset-bot
Copy link

changeset-bot bot commented May 3, 2023

🦋 Changeset detected

Latest commit: 8cad4ee

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

This PR includes changesets to release 18 packages
Name Type
@remix-run/dev Patch
create-remix Patch
@remix-run/css-bundle Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch
@remix-run/vercel 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

esbuild cancels builds by throwing cancelation errors,
and we copy the same approach for manually canceling builds

cancelations need to be thrown to stop execution, but they are not
in-themselves errors. so they should not be logged as errors.
@pcattori pcattori marked this pull request as ready for review May 3, 2023 18:59
@pcattori pcattori merged commit ab0b425 into dev May 3, 2023
@pcattori pcattori deleted the pedro/fix-dev-server-cancel branch May 3, 2023 19:32
@uSkizzik
Copy link

uSkizzik commented May 7, 2023

From my experience this will finish all the hanging rebuilds. Sometimes however this will cause one of the rebuilds to fail (if they're ran at the same time) because they try overwriting the same files.

Edit: Ok for some reason it's detecting a bunch of my files have changed and after trying to rebuild it errors out with an EPERM: operation not permitted, lstat

@MichaelDeBoey MichaelDeBoey linked an issue May 8, 2023 that may be closed by this pull request
1 task
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version 1.16.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.16.0 new dev server not finishing rebuilds
2 participants