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 tsconfig.json update causing the server to crash #8736

Merged
merged 1 commit into from
Oct 3, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 3, 2023

Changes

Fix #7835

Couple issues fixed:

  1. 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.

  2. 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.

@changeset-bot
Copy link

changeset-bot bot commented Oct 3, 2023

🦋 Changeset detected

Latest commit: df80a0e

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

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Oct 3, 2023
@ematipico ematipico merged commit d1c75fe into main Oct 3, 2023
13 checks passed
@ematipico ematipico deleted the tsconfig-no-crash branch October 3, 2023 13:36
@astrobot-houston astrobot-houston mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't crash when tsconfig.json is modified
2 participants