kit icon indicating copy to clipboard operation
kit copied to clipboard

npm run dev breaks when an error occurs after updating sveltekit

Open engageintellect opened this issue 3 years ago • 8 comments

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

  1. npm run dev
  2. make an edit that you know will throw an error, in my case, I put a bunch of jibberish in a fetch API.
  3. Click "reload" in browser
  4. 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

engageintellect avatar Sep 14 '22 20:09 engageintellect

Please provide an actual repro, as you were asked in the issue template. The instructions above are too vague to be actionable

Rich-Harris avatar Sep 14 '22 22:09 Rich-Harris

@Rich-Harris , sorry about that. Updated. 👍

engageintellect avatar Sep 15 '22 00:09 engageintellect

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 :/

kevinrenskers avatar Sep 16 '22 12:09 kevinrenskers

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

dummdidumm avatar Sep 19 '22 08:09 dummdidumm

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.

kevinrenskers avatar Sep 19 '22 11:09 kevinrenskers

What do you mean by "hangs forever, nothing happens"? You can reload the page but you can't interact with it?

dummdidumm avatar Sep 19 '22 13:09 dummdidumm

You can reload the page in the browser, but the request never completes. I'll try to create a repro and/or video.

kevinrenskers avatar Sep 19 '22 13:09 kevinrenskers

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.

Rich-Harris avatar Sep 19 '22 22:09 Rich-Harris

Closing due to inactivity and lack of a proper reproduction.

dummdidumm avatar Jan 10 '23 13:01 dummdidumm