Skip to content

Conversation

Rich-Harris
Copy link
Member

#16619 (comment)

We could probably do something similar for async fragments (#16542)

Copy link

changeset-bot bot commented Aug 18, 2025

⚠️ No Changeset found

Latest commit: b975914

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Rich-Harris
Copy link
Member Author

notably the test still passes here even though I didn't reproduce the 'stash the active effect and invoke the error boundary' logic, not sure if that means an additional test is required

Copy link
Contributor

Playground

pnpm add https://pkg.pr.new/svelte@16641

@dummdidumm
Copy link
Member

The difference is that yours has an uncaught exception. Not sure why it doesn't show up in the test.

@dummdidumm dummdidumm merged commit ab5aeda into catch-top-level-await-errors Aug 18, 2025
13 checks passed
@dummdidumm dummdidumm deleted the catch-top-level-await-errors-helper branch August 18, 2025 16:58
Rich-Harris added a commit that referenced this pull request Aug 18, 2025
* fix: properly catch top level await errors

async errors within the template and derived etc are properly handled because they know about the last active effect and invoke the error boundary correctly as a response. This logic was missing for our top level await output.

Fixes #16613

* test

* use helper for async bodies (#16641)

* use helper for async bodies

* unused

* fix

* failing test + fix

---------

Co-authored-by: Simon Holthausen <[email protected]>

---------

Co-authored-by: Rich Harris <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants