Reading issue
sveltejs / svelte · Issue No. 18824
Synchronous throw errors out as cryptic null.f access instead of the original error in production.
<script>
let valid = $state(true);
function load() {
if (!valid) throw new Error("original error");
return Promise.resolve("ready");
}
</script>
<button onclick={() => (valid = false)}>invalidate</button>
<svelte:boundary>
<p>{await load()}</p>
{#snippet pending()}<p>pending</p>{/snippet}
{#snippet failed(error)}<p>{error.message}</p>{/snippet}
</svelte:boundary>
compile with
{ generate: "client", dev: false, experimental: { async: true } }
Mount it, wait for ready, and click invalidate.
original error.Cannot read properties of null (reading 'f') escapes the boundary, which keeps displaying ready.Error; no application code accesses a property of null or undefined.This will NOT manifest in svelte playground because the playground uses dev: true.
N/A
annoyance
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.