-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Immer JS doesn't work with svelte runes #11781
Comments
To narrow this down more, if you simplify the code to do NOTHING. const result = produce(appState, (draft) => {
console.log("woah")
}); You will still get an error
This does not happen if you remove |
Looks like the solution is to use const result = produce($state.snapshot(appState), (draft) => {
console.log("woah")
}); You can close this unless action needs to be taken here |
Since |
It works with frozen, the whole point of |
Oh right, they're doing a proxy themselves etc. Yeah, |
Describe the bug
If you try to use the new runes feature like a store and run ImmerJs's
produce
function on it, you can get a maximum call stack error.In my example, this seems to only happen if the array is not empty once the
produce
function is done. For instance, runningdraft.todos.pop()
twice here will workReproduction
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: