svelte: bug: is not working on SSR
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
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 17 (16 by maintainers)
Yes but
+error.svelteis for HTTP errors, and I donāt want to render an HTTP errorā¦I just want to render the page correctly, without the svelte:boundary part when it fail⦠Like with a try/catchā¦
But IMHO I think the SSR should generate the same result⦠Itās incorrect to generate an HTTP 500 in this case.