Skip to content

svelte:boundary fails with async onMount #15151

@Serator

Description

@Serator

Describe the bug

// App.svelte

<script>
  import Test from './Test.svelte'
</script>

<svelte:boundary>
  <Test />

  {#snippet failed()}
    Error occurred!
  {/snippet}
</svelte:boundary>
// Test.svelte

<script>
  import {onMount} from 'svelte'

  onMount(async () => {// <<< The `async` keyword here prevents the message in `snippet failed()` above.
    throw Error()
  })
</script>

The message Error occurred! does not appear if onMount is async. If you remove the async keyword from the code above, everything works as expected.

Reproduction

v5.19.5

Logs

System Info

-

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions