-
-
Notifications
You must be signed in to change notification settings - Fork 856
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
import and call enableMapSet()
error happens even after enableMapSet() is called.
#1022
Comments
Typically one of two things is happening here:
|
|
I don't know how to test it in your sandbox, but it seems you have both xstate/immer and immer as dependencies, so enableMapSet is probably called on the wrong one, and I guess you don't need to install immer manually, or make sure to dedupe it. |
So I removed immer, then I get this.
And I don't see |
I just checked the @xstate/immer sources, they correctly set up immer as peer dependency, so it indeed needs to be included, and So I think this issue is specifically caused by Next.js. I don't know how Next.js works, what is bundled on server vs client, or whether it brings an own internal 9.0.12 Immer version somewhere. So I think you can best raise this one with the Next.js community. Edit: or you can ask @xstate/immer folks to enable MapSet by default, that'd fix the issue as well I suspect |
To Reproduce
Steps to reproduce the behavior:
https://codesandbox.io/p/sandbox/thirsty-dan-4e3o9r
enableMapSet()
in the code, but the error saysChange the version to 9.0.12, then restart. Now the error is gone.
Observed behavior
A description of what behavior you observed and why you consider it faulty.
Expected behavior
A clear and concise description of what you expected to happen instead.
Environment
We only accept bug reports against the latest Immer version.
setUseProxies(true)
setUseProxies(false)
(ES5 only)The text was updated successfully, but these errors were encountered: