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(hmr): propagate fs.stat failure for hmrContext.read #15568

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

appden
Copy link
Contributor

@appden appden commented Jan 11, 2024

Description

This fixes an unhandled promise rejection that could occur if a file disappeared during the polling period inside readModifiedFile (aka hmrContext.read). This unhandled rejection would cause the vite server to crash.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

This fixes an unhandled promise rejection that could occur if a file disappeared during the polling period inside `readModifiedFile` (aka `hmrContext.read`). This unhandled rejection would cause the vite server to crash.
Copy link

stackblitz bot commented Jan 11, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks like the timeout is moved early on the first loop, but I guess it's more common to detect changes this way instead of two consecutive stats.

@bluwy bluwy changed the title fix(hmr): Propagate fs.stat failure for hmrContext.read fix(hmr): propagate fs.stat failure for hmrContext.read Jan 11, 2024
@patak-dev patak-dev merged commit c6d240b into vitejs:main Jan 11, 2024
10 of 11 checks passed
@appden appden deleted the fix-hmr-read branch January 11, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants