kit
kit copied to clipboard
npm run dev breaks when an error occurs after updating sveltekit
Describe the bug
Previous to the sveltekit update, I was able to run a local sever and code without the server dropping out or disconnecting.
Since the update, I often will find that my dev server has broken after encountering an error.
Is this a vite issue? Not sure if this BR belongs here, but it only started happening after migrating my project to the new version of sveltekit.
Reproduction
- npm run dev
- make an edit that you know will throw an error, in my case, I put a bunch of jibberish in a fetch API.
- Click "reload" in browser
- see dev server fail
Here is a short clip that illustrates the issue (frontend server is running in the top right):
https://user-images.githubusercontent.com/61082194/190288537-63617042-9ec2-4ce8-a165-5e9a74ee2952.mp4
Logs
No response
System Info
System:
OS: Linux 4.4 Ubuntu 20.04.5 LTS (Focal Fossa)
CPU: (8) x64 Intel(R) Core(TM) i5-10310U CPU @ 1.70GHz
Memory: 4.28 GB / 15.73 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.17.0 - /usr/local/bin/node
Yarn: 1.22.18 - /usr/local/bin/yarn
npm: 8.15.0 - /usr/local/bin/npm
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.72
@sveltejs/kit: next => 1.0.0-next.480
svelte: ^3.49.0 => 3.50.1
vite: ^3.0.0 => 3.1.0
Severity
serious, but I can work around it
Additional Information
No response
Please provide an actual repro, as you were asked in the issue template. The instructions above are too vague to be actionable
@Rich-Harris , sorry about that. Updated. 👍
This happens quite often, indeed after you made some kind of error. It's bad enough that I have to kill the dev server, stop the request in the browser, start the dev server, open the home page of my app again, and then go back to the page I was before. I can't just refresh the original page or the browser just hangs. In the dev server console I do see requests coming in just fine, but the browser hangs forever.
I've also wanted to make an issue for this as this has been getting worse and worse, but can't really make it into a small repro :/
What exactly does "break" mean in this context? It looks like it is still running, and the error is a runtime error coming from user code (my guess is that srsearch is unset if you reload, and then wikipedia returns a response with an error, so query.search is undefined, as the error suggests).
When this happens the server is indeed still running, and you can see new requests getting logged to the console when you try to open or refresh a page. But the browser just hangs forever, nothing happens. You need to restart the server.
What do you mean by "hangs forever, nothing happens"? You can reload the page but you can't interact with it?
You can reload the page in the browser, but the request never completes. I'll try to create a repro and/or video.
That's not a repro, it's a video.
If someone can provide an actual repro, we can investigate. Until then, I'm not sure what we can do.
Closing due to inactivity and lack of a proper reproduction.