-
Notifications
You must be signed in to change notification settings - Fork 111
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
ern run-ios failing with mkdirp error #1891
Comments
I seem to have found the issue, but I am still tracing why it is happening. When the iOS container is generated, it is not installing the correct dependencies from the package.json file. The file
The metro-cache package specifies the same dependency. And the yarn.lock file actually shows the correctly resolved dependency:
However, when the container generation finishes, the actually installed version of mkdirp is 3.0.0, which removed the default exports. So at some point the container generation for iOS is installing the wrong dependency, and that is what is breaking everything. If we run @Karthiccc23 @friederbluemle any ideas on where to look? |
Seems like the correct version of mkdirp (0.5.6) gets installed briefly, then it gets overwritten by the pod install command:
The pod install command is removing the existing one and installing the latest version. |
The issue is happening on the Later during the react-native-codegen function, it manually adds the mkdirp dependency again without checking the required version on the main packages.json file. At this point the latest version of the mkdirp library that contains breaking changes is added and then merged into the node_modules folder. Would it be better to not remove the mkdirp library from the initial node_modules or to ensure we check for a particular version on the package.json file to install the correct version (if one exists)? |
Hello everyone,
Starting last Monday April 10 we noticed that existing apps can no longer run locally on iOS. Running the
ern run-ios
command gives this error:I tried to build the .xcworkspace on Xcode and I got this error:
Looking at the
generate-specs-cli.js
file, I see that it is requiring mkdirp, this is the line requiring the library:const mkdirp = require('mkdirp');
Looking into the mkdirp library it is loading, I see that it is exporting this:
So the mkdirp object being imported is actually
mkdirp.mkdirp.sync
, I can fix it either by fixing the sync call or the require likeconst { mkdirp } = require('mkdirp');
.If I make either change above and rebuild it with Xcode, it runs the application correctly. But if I run the
ern run-ios
command again, it overrides the changes and breaks again. This miniapp was running correctly last Friday, April 7, and all of our miniapps stopped working on the following Monday. I haven't seen any change on Electrode that could've caused this error, and we haven't changed our apps either. This has happened to multiple devs, so it's does not seem like a local machine issue.Does anyone have any ideas of what could be happening?
ern version: v0.50.1
miniapp react native version: 0.66.5
node: v16.17.0
npm: 8.15.0
The text was updated successfully, but these errors were encountered: