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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While trying to resolve module immer@10.0.2 React Native #1058

Closed
nhchuongchkst19 opened this issue Jul 28, 2023 · 7 comments · May be fixed by FengShangWuQi/fengshangwuqi.github.io#1899
Closed
Labels

Comments

@nhchuongchkst19
Copy link

Error: While trying to resolve module immer from file /app/screens/comment.tsx, the package /build/node_modules/immer/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/node_modules/immer/dist/immer.mjs. Indeed, none of these files exist

Originally posted by @nhchuongchkst19 in #331 (comment)

@darwinshameran
Copy link

Having the same issue, it's preventing us from upgrading. 😞

@mweststrate
Copy link
Collaborator

mweststrate commented Aug 14, 2023

The package.json's main file points to "./dist/cjs/index.js" at https://unpkg.com/immer@10.0.2/package.json which does exist, https://unpkg.com/immer@10.0.2/dist/cjs/index.js. So this sounds rather like an issue in your build setup or React Native (maybe some cache needs clearing)? The react-native config indeed specifies dist/immer.mjs, but again, that file exists: https://unpkg.com/immer@10.0.2/dist/immer.mjs.

cc @markerikson did you get similar reports for Redux, since we follow basically the same module config?

@markerikson
Copy link
Contributor

markerikson commented Aug 14, 2023

None of our changes are officially released yet :) They're all still in beta.

(Related, I put up a blog post last week recapping all my efforts to modernize the Redux packages, including some mentions of helping Immer: https://blog.isquaredsoftware.com/2023/08/esm-modernization-lessons/ )

Unfortunately I don't use RN myself, so I don't have an easy way to repro / check on this.

@mweststrate
Copy link
Collaborator

Possible solution is mentioned here: #1065 (comment)

@mweststrate
Copy link
Collaborator

I think immer@10.0.3-beta solves it for everyone. Would someone mind verifying? Then I'll cut an official release.

@dmotz
Copy link

dmotz commented Sep 30, 2023

@mweststrate I tried 10.0.3-beta in a React Native app that wasn't working with previous 10.x versions, and can confirm 10.0.3-beta fixes the issue 👍

@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2023

🎉 This issue has been resolved in version 10.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

5 participants