Skip to content

SvelteKit 3 hydration crashes with async content and a pending boundary #17383

Open

Description

@Tinggaard

Describe the bug

Under some circumstances Svelte throws a TypeError in an internal root.svelte file whilst rendering.

I have found multiple variables that all help invoke this bug, but I cannot tell exactly what is triggering it. I've narrowed far down though.

It happens on initial load of a page that has two +layout.server.ts files returning data, where a sub-page of these read the data from both load functions, and must also include a <svelte:boundary> with a pending snippet, as well as an async call.

I've described it in further detail in the reproduction-repo.

Also, it does not reproduce on SvelteKit 2.70.3.
Tested in both Firefox and Chromium.

As it does not reproduce in SvelteKit 2.70.3, I assume that it is not a bug in svelte, but I am not sure.

Reproduction

https://github.com/Tinggaard/sveltekit3-root-properties-undefined

For the SvelteKit 2 (non-)reproduction, checkout the sveltekit-2 branch of the repo.

Logs

Uncaught TypeError: can't access property "error", n() is undefined

  in <unknown>
  in +layout.svelte
  in root.svelte
  in undefined
    Error root.svelte:23
    update_reaction runtime.js:253
    execute_derived deriveds.js:368
    update_derived deriveds.js:391
    get runtime.js:691
    get onerror root.svelte:30
    error boundary.js:477
    invoke_error_boundary error-handling.js:72
    handle_error error-handling.js:47
    update_reaction runtime.js:314
    update_effect runtime.js:479
    flush_queued_effects batch.js:1121
    #process batch.js:444
    flush batch.js:677
    ensure batch.js:922
    run_all utils.js:47
    run_micro_tasks task.js:10
    queue_micro_task task.js:28
 root.svelte:23:26
    Error root.svelte:23
    update_reaction runtime.js:253
    execute_derived deriveds.js:368
    update_derived deriveds.js:391
    get runtime.js:691
    get onerror root.svelte:30
    error boundary.js:477
    invoke_error_boundary error-handling.js:72
    handle_error error-handling.js:47
    update_reaction runtime.js:314
    update_effect runtime.js:479
    flush_queued_effects batch.js:1121
    #process batch.js:444
    flush batch.js:677
    ensure batch.js:922
    run_all utils.js:47
    run_micro_tasks task.js:10
    queue_micro_task task.js:28

System Info

System:
    OS: Linux 7.2 Fedora Linux 44 (Workstation Edition)
    CPU: (16) x64 AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
    Memory: 4.31 GB / 27.14 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.15.0 
    npm: 11.12.1 
    pnpm: 12.6.0 
  Browsers:
    Firefox: 156.0.1
    Firefox Developer Edition: 156.0.1
  npmPackages:
    @sveltejs/adapter-auto: ^8.0.0 => 8.0.0
    @sveltejs/kit: ^3.0.1 => 3.0.1
    @sveltejs/vite-plugin-svelte: ^7.2.0 => 7.3.1
    svelte: ^5.57.2 => 5.57.2
    vite: ^8.3.0 => 8.3.3

Severity

blocking an upgrade

Additional Information

No response

Activity

  1. changed the title [-]`TypeError` in internal `root.svelte` file[/-] [+]SvelteKit 3 hydration crashes with async content and a pending boundary[/+] on Oct 8, 2026
  2. teemingc commented on Oct 9, 2026

    @teemingc
    Member

    We changed Root.svelte in Kit 3 so it might be a bug there

  3. added theissue type on Oct 13, 2026
  4. mathieuser commented on Oct 13, 2026

    @mathieuser

    Hi, I have a similar problem here, but on client-side navigation. Initial load is fine, but client-side navigation crashes sometimes with this error:

    app.js:54 TypeError: Cannot read properties of undefined (reading 'data') at root.svelte:24:26 at update_reaction (runtime.js:253:16) at execute_derived (deriveds.js:368:12) at update_derived (deriveds.js:391:14) at is_dirty (runtime.js:169:5) at flush_eager_effects (sources.js:294:12) at internal_set (sources.js:274:4) at Module.set (sources.js:168:9) at set child (props.svelte.js:61:7) at apply_navigation_result (client.js:3803:19)

  5. teemingc commented on Oct 13, 2026

    @teemingc
    Member

    Note to self to check if this gets fixed after sveltejs/svelte#18880 is released

    EDIT: it seems like it doesn't fix the issue. I've opened on on the Svelte repository sveltejs/svelte#18993

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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