-
-
Notifications
You must be signed in to change notification settings - Fork 852
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
Possible breaking change in package exports in v9.0.13 #937
Comments
Your bundler most likely does not understand |
FWIW, it isn't "my" bundler :) I'm a Redux Toolkit maintainer (RTK relies on Immer), and one of our users reported the bug against RTK. Tbh this is the sort of thing that scares me about trying to change package export setup for RTK itself, and why I refuse to touch our setup until we're ready for a major. |
So it's your users bundler :) And here a quote by one of the collaborators (@mweststrate)
Well, guess he has been right :) |
related to #938 this is indeed a breaking change a big a problem for library maintainers. We have a build system where we generate projects on the fly with a framework that has reduxjs/toolkit as a dependency (and therefore immer). All our builds on our existing versions of our framework are now broken because of this. This should definitely not be published as a patch update :/ I hope it will be rolled back ASAP and included in the next major version instead as @hirbod suggested |
@markerikson +1 I am a user of redux toolkit package and it is breaking on immer in react-native. |
fixed in #939 and available in 9.0.14 |
Sorry for the inconvenience folks! Seems it is is somehow impossible to be a good ESM citizen without breaking stuff. At least no idea how to verify that it is done correctly before pushing it in the wild :). |
no worries @mweststrate , you reacted promptly so that's good :) |
@mweststrate thanks for the fix! FWIW, my only real answer here is to do test publishes locally with |
Wanted to follow up on this in two ways:
It might be worth re-considering this set of changes for an Immer 10.0? |
🐛 Bug Report
We just had a user file a Redux Toolkit bug report saying that as of Immer v9.0.13, RTK fails to initialize correctly, with a classic
Object(...) is not a function
error messagereduxjs/redux-toolkit#2315
Looking at the changes in v9.0.12...v9.0.13 , I see that there was a recent PR changing how Immer does its exports:
#921
This seems like a likely candidate for causing this kind of problem.
Note that this change was not called out in the 9.0.13 release notes, and also seems like it's a much bigger change than a "patch"-level release. (FWIW I've been advised that changes to
exports
inpackage.json
probably justify being breaking majors.)Link to repro
Don't have a repro yet - the end user just reported this a few minutes ago.
Observed behavior
It looks like Immer's exports have potentially changed, depending on the build/run environment. (Don't know details on the end user's environment yet).
Expected behavior
Immer's imports load cleanly.
Environment
We only accept bug reports against the latest Immer version.
Rest of user environment is unknown, have asked for more details.
The text was updated successfully, but these errors were encountered: