Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurs when nesting patches and changing the level of [tree structure data] #916

Open
Alt-er opened this issue Mar 11, 2022 · 1 comment

Comments

@Alt-er
Copy link
Contributor

Alt-er commented Mar 11, 2022

馃悰 Bug Report

An error occurs when nesting patches and changing the level of [tree structure data]

Link to repro

https://codesandbox.io/s/minimal-repro-forked-xvb93p

To Reproduce

1.remove a node
2.Add a new node where it was previously removed
3.Add previously deleted nodes to a subset of new nodes

Observed behavior

An error occurs when using nextData

Expected behavior

should not go wrong

Environment

immer verson :9.0.12

Use default configuration

@oriSomething
Copy link
Contributor

I think it's related to how Proxy.revocable() works (see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable).
You can use enableES5(true), and setUseProxies(false) as work around. But I guess the bug related to revoke() to be called too early (means it's need to be called after all drafts finished, but I don't think it will solve all this kind of these issues).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants