Skip to content

bug: <svelte:boundary> is not working on SSR #15370

Open
@adiguba

Description

@adiguba

Describe the bug

The <svelte:boundary> do nothing on SSR !

On the REPL we can see that code like this :

<svelte:boundary>
	template
	{#snippet failed()}
		error
	{/snippet}
</svelte:boundary>

Will generate this server code :

	{
		function failed($$payload) {
			$$payload.out += `<!---->error`;
		}

		$$payload.out += `<!---->template`;
	}

The template is written, but there no try/catch and the failed() snippet is never caller when an error occurs in the template !

Actually this will produce an HTTP 500 error :(

I think it should render the failed() snippet instead...

Reproduction

Click on the links "Bad page" and "Good page" to see that the error is handheld on client-site.
Then, when on the "Bad page", click on the "reload to force SSR" button to regenerate the page via SSR... => HTTP 500

https://www.sveltelab.dev/ravzziihmogkq1a

Logs

System Info

Done on sveltelabs with last version

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