Skip to content

Svelte 5: $effect.pre() callable without error outside of component initialisation #9410

@robertadamsonsmith

Description

@robertadamsonsmith

Describe the bug

$effect.pre() can be called outside of component initialisation without error, unlike $effect().

This is not documented behaviour, and is possibly not intended.

(Arguably it is useful that $effect.pre() can be called asynchronously in this way, and relates to the more general issue raised here: #9265)

Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAACkVPu2rEMBD8FSGu8D3IPUrHNqRMny5OcZbHIE4vpFUgCP175FOCu52ZnZndxBepEHj7mbi5a_CWvznHT5x-3ArCNxSh4GCjFyvTBeGlo2E0IykQM1FP8Kxnu0B3QnPdv_5Ls42Twrxpm0QI9AQB9CE1bKSm2fdDWrmRdlgWCHpxHk96S6p1h1uNyqfr5VJGGk133g4z3RSJrGHWtEJJ8ejTmlK9x2Me3o3w0DDUnetmcaUqZ3Zgt1KU_jpzeV7bWS4SM2_JR-Sv_AvW9s7bNwEAAA==

Logs

No response

System Info

https://svelte-5-preview.vercel.app/

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions