You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error Resolving react-native-executorch Module in React Native App
Description
I attempted to run the Llama model inside my React Native app using the react-native-executorch library. I followed the setup instructions provided in the library’s GitHub repository, but upon running the app, I encountered a module resolution error.
The error message states:
While trying to resolve module react-native-executorch, the package was found, but the main module field could not be resolved (lib/commonjs/index.js does not exist).
This suggests that the expected entry file (index.js) is missing inside the lib/commonjs/ directory of the react-native-executorch package. As a result, the module fails to load when the application starts.
Steps Taken:
Installed react-native-executorch using:
npx expo install react-native-executorch
Followed the official documentation and added the necessary imports and model initialization code to my React Native component.
Attempted to run the app using:
npx expo start
Encountered the module resolution error in the terminal and the app failed to start.
Tried clearing the cache with:
npx react-native start --reset-cache
However, the issue persisted.
I have attached screenshots of the error and my code for reference. Any guidance on resolving this issue would be appreciated!
Steps to reproduce
Create a new React Native project using Expo or React Native CLI.
Install the react-native-executorch package:
npx expo install react-native-executorch
Import and initialize the Llama model as per the official documentation.
Run the app using:
npx expo start
Observe the error indicating that react-native-executorch cannot resolve its main module.
Hi!
I tried running the app but it failed with a different error on my machine (not coming from react-native-executorch). I changed metro config to this one and it seems to work but also, I can see that you're trying to run the library with Expo Go. As mentioned in the docs, we do not support Expo Go since our library uses native code. You can try running the app with: yarn prebuild
and then running: cd ios && pod install && cd .. && yarn expo run:ios -d
or: yarn expo run:android -d
Let me know if that works!
Description
Error Resolving
react-native-executorch
Module in React Native AppDescription
I attempted to run the Llama model inside my React Native app using the
react-native-executorch
library. I followed the setup instructions provided in the library’s GitHub repository, but upon running the app, I encountered a module resolution error.The error message states:
This suggests that the expected entry file (
index.js
) is missing inside thelib/commonjs/
directory of thereact-native-executorch
package. As a result, the module fails to load when the application starts.Steps Taken:
react-native-executorch
using:However, the issue persisted.
I have attached screenshots of the error and my code for reference. Any guidance on resolving this issue would be appreciated!
Steps to reproduce
Snack or a link to a repository
https://github.com/pawan-30/react-native-executorch-bug
React Native Executorch version
0.2.0
React Native version
0.76.7
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
AI model
LLAMA3_2_1B_QLORA
Performance logs
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: