-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed as not planned
Closed as not planned
Copy link
Description
Describe the bug
When updating state inside of an event handler for the outrostart event on a node, the following error occurs:
Uncaught Svelte error: state_unsafe_mutation
Updating state inside a derived or a template expression is forbidden. If the value should not be reactive, declare it without `$state`
This does not happen if using the onoutrostart callback prop, or other transition events/props
Reproduction
https://svelte.dev/playground/81e7a862e846456d9254886c17d18fbb?version=5.1.9
You'll see the error when toggling out
Logs
No response
System Info
System:
OS: macOS 15.0.1
CPU: (10) arm64 Apple M1 Max
Memory: 157.22 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
pnpm: 8.12.0 - /opt/homebrew/bin/pnpm
bun: 1.0.0 - ~/.bun/bin/bun
Browsers:
Chrome: 130.0.6723.92
Safari: 18.0.1
npmPackages:
svelte: ^5.1.2 => 5.1.2Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels