repack icon indicating copy to clipboard operation
repack copied to clipboard

Error: repack react native module was not found. Did you forget to update native dependencies?

Open DivyatejaChe opened this issue 1 year ago • 5 comments

Ask your Question

Screenshot 2024-05-07 at 04 46 16
  • Error observed when setting up Re.Pack in an existing monorepo created using YARN workspaces
  • Reproducible repo: repack branch in this repo
  • Issue reproducible on both Android and iOS
  • Performed pod install too
  • Please note that I have hoisted all the dependencies at the root level of the monorepo only
  • Path for Bundle React Native code and images set as follows
set -e

WITH_ENVIRONMENT="../../../node_modules/react-native/scripts/xcode/with-environment.sh"
export BUNDLE_COMMAND=webpack-bundle
REACT_NATIVE_XCODE="../../../node_modules/react-native/scripts/react-native-xcode.sh"

/bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE"

DivyatejaChe avatar May 06 '24 23:05 DivyatejaChe

hello @jbroma , can you help take a look into this, please if you have a few mins? I see that its an error thrown by Re.Pack in ScriptManager.js. Would you know in what scenarios it could not find the native module?

DivyatejaChe avatar May 07 '24 11:05 DivyatejaChe

@DivyatejaChe

The reproduction repository you've provided is not public, therefore I won't be able to assist you directly. You can contact [email protected] if you want us to take a closer look at that.

Have you tried using the latest RC release 4.0.0-rc.2? Perhaps the issue will resolve itself when you use it, we fixed a ton of things since 3.7.0.

jbroma avatar May 07 '24 15:05 jbroma

hey @jbroma , I just made the repo public. Can you please take a look? Please make sure to check the repack branch, not the 'main'

DivyatejaChe avatar May 07 '24 15:05 DivyatejaChe

As for the latest RC release, is there any breaking changes from 3.x.x or is the migration smooth? @jbroma

DivyatejaChe avatar May 07 '24 15:05 DivyatejaChe

@DivyatejaChe thanks, I'll take a look tomorrow. As for the migration process, it should be relatively smooth, you can check last few release notes, should be all listed there. Migration guide is in the works.

jbroma avatar May 07 '24 17:05 jbroma

@DivyatejaChe after taking a quick look - please don't add @callstack/repack in the root of your repo, instead add it as a devDependency of each app where you use it. That's probably why autolinking was failing and your module was not found. Please see if that helps.

jbroma avatar May 08 '24 11:05 jbroma

@DivyatejaChe after taking a quick look - please don't add @callstack/repack in the root of your repo, instead add it as a devDependency of each app where you use it. That's probably why autolinking was failing and your module was not found. Please see if that helps.

hey @jbroma, thanks for the help! I upgraded to 4.0.0 and was able to run. Congrats on the new release!

DivyatejaChe avatar May 20 '24 04:05 DivyatejaChe