-
-
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
React Native compilation problem #938
Comments
I had the same problem, this is most likely related to the ESM changes that many packages start doing. // Learn more https://docs.expo.io/guides/customizing-metro
const {
getDefaultConfig
} = require('expo/metro-config');
const path = require('path');
const config = getDefaultConfig(__dirname);
// Monorepo
const projectRoot = __dirname;
const workspaceRoot = path.resolve(__dirname, '../..');
config.watchFolders = [workspaceRoot];
config.resolver.nodeModulesPath = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules')
];
config.resolver.sourceExts.push('mjs'); // this is the required fix
module.exports = config; Note that my metro config is based off Expo, if you're using bare RN you'll need to add I still think that immerjs should also support react-native ootb, there are many issues in this direction lately from many packages, like uSES, react-query, apollo. etc. That's the line that caused the issues: |
Is there a plan to do anything about this ? we have a framework that uses reduxjs/toolkit as a dependency. With this, all our earlier versions are now breaking in new projects, unless people add a specific resolution for immer version, which is quite problematic |
+1 facing this same issue |
+2 facing this same issue |
#939 |
I can confirm that the fix is working |
yes, this can be closed, #939 was merged and is available in 9.0.14 |
I think we can close this issue as of now as it has been fixed. |
Yup, closing it now, thank you all for help! |
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 error While trying to resolve module
immerfrom file
C:\Users\nadre\Documents\Proyectos\ocho-react\node_modules@reduxjs\toolkit\dist\redux-toolkit.cjs.production.min.js, the package
C:\Users\nadre\Documents\Proyectos\ocho-react\node_modules@reduxjs\toolkit\node_modules\immer\package.jsonwas successfully found. However, this package itself specifies a
mainmodule field that could not be resolved (
C:\Users\nadre\Documents\Proyectos\ocho-react\node_modules@reduxjs\toolkit\node_modules\immer\dist\immer.esm.mjs`. Indeed, none of these files exist:I can't compile my code
I was trying to compile in react native redux tookit that uses immer and it seems is not working anymore for some reason.
The text was updated successfully, but these errors were encountered: