sveltejs / sveltejs/kit

Streaming with Promises and connection loss

Open
#11,667 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

error handling
Dominant language
JavaScript
Stars
20.8k
Forks
2.3k
Avg merge
1d 16h
Merged PRs (30d)
156

Description

Describe the bug

When the connection is lost while streaming from a server-side load function using Promises, the error 'net::ERR_INTERNET_DISCONNECTED 200' is logged in the console. However, I have found no way to handle this error within the Svelte Kit project. It does not trigger any hooks. Is it possible to handle such errors within Svelte Kit?

Reproduction

Reproduction

I did not find a possibility to reproduce the error in a container.

When running this app in a local dev server using chrome, throttle the network speed to slow 3G in the chrome dev tools tab network. While the data is streaming change the network speed to offline. The 'net::ERR_INTERNET_DISCONNECTED 200 ' error will be logged in the console.

Logs

No response

System Info
System:
    OS: Windows 11 10.0.22621
    CPU: (8) x64 Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
    Memory: 6.31 GB / 15.88 GB
  Binaries:
    Node: 20.10.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (119.0.2151.44)
    Internet Explorer: 11.0.22621.1
  npmPackages:
    @sveltejs/adapter-auto: ^3.0.0 => 3.1.0
    @sveltejs/kit: ^2.0.0 => 2.3.5
    @sveltejs/vite-plugin-svelte: ^3.0.0 => 3.0.1
    svelte: ^4.2.7 => 4.2.9
    vite: ^5.0.3 => 5.0.11
Severity

annoyance

Additional Information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked StackBlitz reproduction and the server-side load function that streams data using Promises. Reproduce the disconnect by throttling Chrome to slow 3G, then switching to offline while data is streaming, and inspect whether any SvelteKit hooks receive the error. Done should establish whether the error can be handled within SvelteKit and identify the supported handling path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.