-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
effect_orphan $effect
can only be used inside an effect
#15332
Comments
What would you suggest? When something's imported like that, it's just run once, outside of the initialization of any particular component. You'd have to put the |
I do think we should better explain |
There's no obvious corrective action for the user to take. The error msg is almost cyclical. Clicking through the url leaves them with the same error msg. Users expect that to work because they can do this // foo.svelte.js
// This works
export const foo = $state({value: 1})
// So they think this works, mirroring a *.svelte component
$effect(()=>{
conole.log('here')
}) I think defining |
https://discord.com/channels/457912077277855764/1343686205694541905
Here's another instance of someone using |
Describe the bug
Difficult to understand error msg.
Reproduction
REPL
Related
https://discord.com/channels/457912077277855764/1341461743305494609
Severity
annoyance
The text was updated successfully, but these errors were encountered: