Replies: 9 comments
-
How are you installing the library in the app? |
Beta Was this translation helpful? Give feedback.
-
In the package.json in the "dependencies" I've added this: "testlib": "https://url/path/testlib.git", The testlib library is retrieved from a private git repo. |
Beta Was this translation helpful? Give feedback.
-
Depending on which package manager you use, you'd need to use either More details here https://callstack.github.io/react-native-builder-bob/build#manual-configuration |
Beta Was this translation helpful? Give feedback.
-
Thank you for the suggestion I wasn't aware of that option. In the library package.json I've set
Using prepack instead of prepare but unfortunately looks like the problem is still there. :-( |
Beta Was this translation helpful? Give feedback.
-
Can you create a demo repo with a test app and one with a test library that replicates enough your setup to reproduce the issue? |
Beta Was this translation helpful? Give feedback.
-
For the test app and test library you can simply use create-react-native-library. |
Beta Was this translation helpful? Give feedback.
-
Hey, could you also fill which options you've picked? You've provided:
but this is not enough for us to take care of this issue. We need more details so we can understand where this issue is coming from. Could you provide the project type, languages, and the example app? |
Beta Was this translation helpful? Give feedback.
-
Hey guys, I'm using yarn and I have very same issue. Reproducing the issue is very easy:
Thats it. @atlj |
Beta Was this translation helpful? Give feedback.
-
According to Yarn docs, https://v3.yarnpkg.com/advanced/lifecycle-scripts Please confirm your project's Yarn version. If it's not running It's only an issue in Bob if |
Beta Was this translation helpful? Give feedback.
-
Description
I've just created a test library using create-react-native-library, the example works correctly but if I import the library in an external RN project (an app) I cannot use the "default" import path:
import { multiply } from 'testlib'
but I have to add "src" ad the end to make it work:
import { multiply } from 'testlib/src'
This happens using the latest RN 0.75.2.
Is there a workaround for this?
Thank yuo.
Packages
Selected options
npx create-react-native-library@latest testlib
Link to repro
npx create-react-native-library@latest testlib
Environment
System:
OS: macOS 14.4.1
CPU: (11) arm64 Apple M3 Pro
Memory: 100.89 MB / 18.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.17.0
path: ~/.local/share/rtx/installs/node/18.17.0/bin/node
Yarn:
version: 3.6.1
path: ~/.local/share/rtx/installs/node/18.17.0/bin/yarn
npm:
version: 9.6.7
path: ~/.local/share/rtx/installs/node/18.17.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK: Not Found
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11255304
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: javac 17
path: /Users/user/.local/share/rtx/installs/java/oracle-17/bin/javac
Ruby:
version: 3.2.2
path: /Users/user/.local/share/rtx/installs/ruby/3.2.2/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.75.2
wanted: 0.75.2
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: false
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
Beta Was this translation helpful? Give feedback.
All reactions