Fix tsconfig.json
update causing the server to crash
#8736
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Fix #7835
Couple issues fixed:
Handle server
ERR_CLOSED_SERVER
error if accessing the module graph after the server has been closed. Ideally Vite shouldn't ever expose this, but there isn't a nice solution without removing that safeguard.When
tsconfig.json
updates, the server restarts and reloads at the same time, causing the page to be blank and doesn't show the new page after server is ready again. I did a hack to prevent the reload, as the restart also initiates a reload by itself when it's ready.The reload is done by Vite by default so there's not much we can do to prevent it in the first place.
Testing
Tested manually.
Docs
n/a. bug fix.