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

react native can not recognize .mjs file #331

Closed
sunnylqm opened this issue Mar 13, 2019 · 6 comments · Fixed by #332
Closed

react native can not recognize .mjs file #331

sunnylqm opened this issue Mar 13, 2019 · 6 comments · Fixed by #332

Comments

@sunnylqm
Copy link

error: bundling failed: Error: While trying to resolve module immer from file /Users/.../src/reducers/uiStateReducer.ts, the package /Users/.../node_modules/immer/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/.../node_modules/immer/dist/immer.mjs.

Related to b9f0029#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

@mohsinulhaq
Copy link

image
Is the fix going to address this issue as well? @egoist

@egoist
Copy link
Contributor

egoist commented Mar 13, 2019

@mohsinulhaq probably, you can rename your node_modules/immer/dist/immer.mjs to immer.module.js and update the react-native field in the node_modules/immer/package.json accordingly to see if it works.

@mohsinulhaq
Copy link

I have since pinned immer version to 2.1.1 and everything is fine

@aleclarson
Copy link
Member

🎉 This issue has been resolved in version 2.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@nhchuongchkst19
Copy link

This error reappears at version 10.0.2

@aardvarkk
Copy link

Confirm v10 seems to break React Native compatibility (at least for me on RN v0.63.5). Downgrading to v9 fixed the problem for me.

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

Successfully merging a pull request may close this issue.

6 participants