-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
ERROR TypeError: 0, _expoModulesCore.requireOptionalNativeModule is not a function (it is undefined), js engine: hermes #26570
Comments
Fixed by adding into my package.json
|
im having this issue now |
Mine worked by adding "@expo/config-plugins": "7.2.2", |
I also just got this issue after i rm -rf my node_modules and package-lock.json and then npm install. It was working perfectly before this. However adding the "@expo/config-plugins": "7.2.2", did not work for me (i already have "expo-constants": "~14.4.2",). |
this is exactly what happend, was working fine till i had to remove node modules and re install, i’m using Node 18 and i already have expo config plugin installed as we as expo constants, do i have to uninstall and install again? |
@jianrontan Try |
alright will try this |
I actually managed to (temporarily i guess) fix the issue by replacing my package-lock.json with the one from a previous commit and then npm installing the node modules. I will try to do npx expo-doctor with the faulty package-lock.json. |
thx work for me |
this ended up working for me, adding @expo/config-pligins and running npx expo install —fix solved the issue, thanks👌🏽 |
It still doesn't work for me. I ran npx expo-doctor and found out a dependency was using @expo/config-plugins 7.8.4 so i added the below to my package.json and then reinstalled everything: |
can you try installing expo constants, or please screenshot the error on your device, sometimes it adds the package causing the issue in it so it can help debug further also try deleting node modules and package lock and running npx expo install again to see if it helps |
I had the same problem. After installing the |
Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue. The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue. A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own. ResourcesCommon concerns"I've only been able to reproduce it in private, proprietary code"You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase. "I didn't have time to create one"That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template. "You can reproduce it by yourself by creating a project and following these steps"This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue. |
hey there! we're happy to help out if we can get a minimal reproducible example. i suspect if you run |
This is my output:
Running For context I started my project with: Received these errors when running
Since running the fix I can successfully run the app in the iOS simulator. Thanks for your help! |
@brentvatne
Would you have any suggestions for the correct method to remove/fix the package error? |
I've published a new version of Router v2 (2.0.15) https://www.npmjs.com/package/expo-router/v/2.0.15 which has less forceful dependency versions. |
I ran FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':react-native-screens:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message) |
I lost a day or two on this and nothing was helping, and then I went again through all the old commits and I tried to remove all the new packages one by one and the one that finally solved it for me is removing expo module scripts: "devDependencies": { So basically running npm uninstall expo-module-scripts solved it for me. |
I have the same issue as everybody else is having. As soon as I wrap my app/_layout.tsx with the ClerkProvider I get the same error message as everybody else does: I've been racking my brains for almost a week now. I've tried all the solutions mentioned above but nothing is fixing the problem. |
Got mine to work by;
Hope it works out for anyone else facing this issue |
I tried, all the fixes above, but still the same, anyone can help?
|
I am facing the same issue and have tried all the above fixes. Is your error resolved? |
after searching for hours I found the exact problem I was facing, clerk/javascript#2650 |
FWIW, I'm getting something similar with Clerk and Expo v51. As soon as I try to use a
|
Minimal reproducible example
Android Bundling complete 13373ms ERROR TypeError: 0, _expoModulesCore.requireOptionalNativeModule is not a function (it is undefined), js engine: hermes ERROR TypeError: 0, _expoModulesCore.requireOptionalNativeModule is not a function (it is undefined), js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if: * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project. * A module failed to load due to an error and
AppRegistry.registerComponent
wasn't called., js engine: hermesSummary
Everything was working about 2 weeks ago, but now I'm getting errors. Nothing has changed in the code
![image](https://private-user-images.githubusercontent.com/42731380/298419913-9348ddf5-03ce-4411-8a5b-fc4ebf1268ac.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk1OTk5MzIsIm5iZiI6MTcxOTU5OTYzMiwicGF0aCI6Ii80MjczMTM4MC8yOTg0MTk5MTMtOTM0OGRkZjUtMDNjZS00NDExLThhNWItZmM0ZWJmMTI2OGFjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI4VDE4MzM1MlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRjOGVkMGI5NzgwOGIwZTM3YmM1MTU5NTkyMzc4MmY4Y2FjNzIxZDhmNjFhM2ExMDM4ZTVmYjE1YTA5MzJlNzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.D8zF0jJQiPyDOV872w4QNbl89S20RPlD35oAhj9pjRQ)
Environment
expo-env-info 1.2.0 environment info:
System:
OS: Windows 10 10.0.19042
Binaries:
Node: 18.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 9.5.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: AI-223.8836.35.2231.11005911
npmPackages:
expo: ^49.0.21 => 49.0.22
expo-router: ^2.0.0 => 2.0.14
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.72.6 => 0.72.6
Expo Workflow: managed
The text was updated successfully, but these errors were encountered: