Skip to content

calling error while streaming promises resets the connection #14684

@jackgdll

Description

@jackgdll

Describe the bug

Since SvelteKit 2.39.0 calling error in a server load function while one of the parent layouts is streaming a promise causes the request to fail instead of responding with the error page

Reproduction

Reproduction: https://github.com/jackgdll/sveltekit-promise-streaming-error

  1. Start the dev server and visit http://localhost:5173/page/subpage
  2. The connection to the server is reset instead of showing the error page
  3. Doing one of the following will restore the expected behaviour:
    • await the promise in src/routes/page/+layout.server.js instead of streaming it
    • pnpm i @sveltejs/kit@<2.39.0 and restart the server
    • move src/routes/page/+layout.server.js to src/routes/+layout.server.js

Logs

no logs, it just fails silently.

System Info

System:
    OS: macOS 26.0.1
    CPU: (12) arm64 Apple M2 Max
    Memory: 77.66 MB / 32.00 GB
    Shell: 4.0.8 - /opt/homebrew/bin/fish
  Binaries:
    Node: 22.14.0
    npm: 10.9.2
    pnpm: 10.17.1
  Browsers:
    Chrome: 141.0.7390.66
    Firefox: 135.0
    Safari: 26.0.1
  npmPackages:
    @sveltejs/adapter-auto: ^6.1.1 => 6.1.1 
    @sveltejs/kit: ~2.39.0 => 2.39.1 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 
    svelte: ^5.39.11 => 5.39.11 
    vite: ^7.1.9 => 7.1.9

Severity

blocking an upgrade

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions