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

Changing tsconfig and vite.config.ts at the same time causes a crash #8598

Closed
7 tasks done
milomg opened this issue Jun 15, 2022 · 1 comment · Fixed by #9106
Closed
7 tasks done

Changing tsconfig and vite.config.ts at the same time causes a crash #8598

milomg opened this issue Jun 15, 2022 · 1 comment · Fixed by #9106
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)

Comments

@milomg
Copy link
Contributor

milomg commented Jun 15, 2022

Describe the bug

If both vite.config.ts and tsconfig.json are saved at the same time, the dev server crashes with

TypeError: Cannot read properties of null (reading 'ws')

The line that it errors on is here:

I would expect this is because the websocket is dropped at the same time the server tries to send an update

To trigger the crash, follow the reproduction link, then once the server is running create a new terminal tab and run touch tsconfig.json && touch vite.config.ts

Reproduction

https://stackblitz.com/edit/solid-vite-queyzr?file=vite.config.ts,tsconfig.json

System Info

System:
    OS: StackBlitz WebContainers

  npmPackages:
    vite: ^2.9.12 => 2.9.12

Used Package Manager

npm

Logs

No response

Validations

@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) and removed pending triage labels Jun 15, 2022
@ZerdoX-x
Copy link

ZerdoX-x commented Jul 11, 2022

Yep. Most often this problem can be encountered when switching branches via git or when code editor autosaves your files on window loose focus.

upd: Also some users have set Ctrl+S as "save all files" and not "save file"

@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants