Giter Site home page Giter Site logo

Comments (3)

fhkarczeski avatar fhkarczeski commented on May 23, 2024

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 /.ern/containergen/out/ios/yarn.lock actually says that mkdirp is a dependency of metro:

[email protected], metro@^0.66.1:
  version "0.66.2"
  resolved "https://registry.yarnpkg.com/metro/-/metro-0.66.2.tgz#f21759bf00995470e7577b5b88a5277963f24492"
  integrity sha512-uNsISfcQ3iKKSHoN5Q+LAh0l3jeeg7ZcNZ/4BAHGsk02erA0OP+l2m+b5qYVoPptHz9Oc3KyG5oGJoTu41pWjg==
  dependencies:
    ...
    **mkdirp "^0.5.1"**
    ...

The metro-cache package specifies the same dependency. And the yarn.lock file actually shows the correctly resolved dependency:

mkdirp@^0.5.1:
  version "0.5.6"
  resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6"
  integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==
  dependencies:
    minimist "^1.2.6"

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 yarn install after the initial creation of the container, and then start the iOS emulator, it also works without a problem. I will keep debugging to see where the mismatch is happening.

@Karthiccc23 @friederbluemle any ideas on where to look?

from electrode-native.

fhkarczeski avatar fhkarczeski commented on May 23, 2024

Seems like the correct version of mkdirp (0.5.6) gets installed briefly, then it gets overwritten by the pod install command:

✔ Running pod install --verbose 7s

The pod install command is removing the existing one and installing the latest version.

from electrode-native.

fhkarczeski avatar fhkarczeski commented on May 23, 2024

The issue is happening on the IosGenerator.ts file. For our version of RN (0.66.5), it is using the code react-native-codegen. After the pod install command runs, the generator is removing all libraries that are not RN related. This removes the correct mkdirp module.

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)?
@friederbluemle @belemaire @Karthiccc23

from electrode-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.