Skip to content
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

[Build] Cannot read property 'install' of null with onnxruntime-react-native imported #19510

Open
ngeor26 opened this issue Feb 13, 2024 · 4 comments
Assignees
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template

Comments

@ngeor26
Copy link

ngeor26 commented Feb 13, 2024

Describe the issue

I have the exact same issue as this, which unfortunately didn't get resolved. I tried all the solutions mentioned in the thread and followed the linked guide to no avail. Same as her, when I comment out the import everything runs fine. I also have the second error that she has as well.I also have 10 npm vulnerabilities that cascade when I try to resolve them (5 moderate, 5 high). Here's the repo: Repository

Urgency

I have 2 days to get this going.

Target platform

IOS, Android

Build script

{
"name": "allergyapp",
"version": "1.0.0",
"scripts": {
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
},
"dependencies": {
"expo": "~50.0.6",
"expo-camera": "~14.0.4",
"expo-media-library": "~15.9.1",
"expo-status-bar": "~1.11.1",
"onnxruntime-common": "",
"onnxruntime-react-native": "
",
"react": "18.2.0",
"react-native": "0.73.4"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}

Error / output

image

Visual Studio Version

No response

GCC / Compiler Version

No response

@ngeor26 ngeor26 added the build build issues; typically submitted using template label Feb 13, 2024
@skottmckay
Copy link
Contributor

Are you able to run the example RN app? That should work without modification if everything is setup correctly.

https://github.com/microsoft/onnxruntime-inference-examples/tree/main/mobile/examples/React_Native/ort-rn-basic-usage

@skottmckay skottmckay added platform:mobile issues related to ONNX Runtime mobile; typically submitted using template and removed build build issues; typically submitted using template labels Feb 14, 2024
@YUNQIUGUO
Copy link
Contributor

YUNQIUGUO commented Feb 14, 2024

I noticed that in your project/package.json file you are using * for specifying the onnxruntime-react-native npm package version. Have you tried to limit that to a specific version like ^1.16.0? (or even older version)

Also as Scott mentioned, the ort-rn-basic-usage example app can work as expected with the onnxruntime-react-native 1.16.0 version package.

Meanwhile, I'll try to clone your project and see if the same issue can be repro'd on my end.

@sophies927 sophies927 added the build build issues; typically submitted using template label Feb 22, 2024
@Vibrat
Copy link

Vibrat commented Aug 4, 2024

I experienced the same situation in my project. For some unknown reason, the OnnxruntimeJSIHelper couldn't not be extracted from NativeModules.

I had to delete all caches: node_modules, package-lock.json, Podfile.lock, build, ... and rebuild everything to make it working again.

@Stanley-Jovel
Copy link

Stanley-Jovel commented Aug 12, 2024

I had to delete all caches: node_modules, package-lock.json, Podfile.lock, build, ... and rebuild everything to make it working again.

This did it for me. Thanks @Vibrat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template platform:mobile issues related to ONNX Runtime mobile; typically submitted using template
Projects
None yet
Development

No branches or pull requests

6 participants