Skip to content

Svelte5 not documented breaking changes in error handling, Error swallowed, svelte:boundary not useful #15625

@rallets

Description

@rallets

Describe the problem

Hi, I'm migrating some apps from Svelte4 to Svelte 5 and I found an undocumented breaking change related to error boundaries.
Ref. https://svelte.dev/docs/svelte/v5-migration-guide

In Svelte4, if an error was thrown in a "store" file (not a svelte component, a typescript file containing a Svelte store), the Error was bubbled up and it was possible to catch it within a

window.addEventListener('unhandledrejection', ()=> { /* handle error */});

In Svelte 5 it's now available svelte:boundary but it doesn't work in this case, the error is never catched.

<svelte:boundary onerror={(e) => { /* handle error */}}>
</svelte:boundary>

Now in Svelte5 the Error is been swallowed. Is there any way it could behave like previously? I tried to look in existing issues but I haven't found anything useful.
This is now a big problem for the migration because the error handling is now broken.

Thanks

Describe the proposed solution

Errors thrown outside a svelte:boundary should bubble up like in Svelte4.

Importance

i cannot use svelte without it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions