React native Invariant Violation: Module AppRegistry...
See original GitHub issueI’m setting up a monorepo with a typescript react native project, and have been facing an error when trying to import my shared code into my RN project.
The error is: Invariant Violation: Module AppRegistry is not a registered callable module
and if I refresh the app it changes to Invariant Violation: No callback found with cbID 2 and callID 1 for module <unknown>. Args: '[{"app_state":"active"}]'
I’ve seen comments and issues telling people to restart the packager with --reset-cache
or reinstall node_modules, and so on, none of those work.
If I comment out the import/usage of imported element from the other package it stops giving me the error and works fine. (packages/supplier_mob/App.tsx line 28
and 54
)
Have anyone experienced it and know how to fix it? Let me know if any questions.
Steps to Reproduce (for bugs)
I’ve stripped the sensitive code and created a minimal reproducible repo at https://github.com/GlisboaDev/learna_mr
lerna.json
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}
Context
The end goal is to have an environment where I can share code between multiple react-native and reactJS projects.
Your Environment
Executable | Version |
---|---|
lerna --version |
3.20.2 |
npm --version |
6.13.7 |
yarn --version |
1.22.4 |
node --version |
v13.11.0 |
OS | Version |
---|---|
macOS Catalina | 10.15.3 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:13
Top GitHub Comments
I also have this issue when applied react-native-navigation
Hi - I am having similar issues unfortunately. Anyone made any progress at all?