Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Module AppRegistry is not a registered callable module

Tags:

reactjs

native

I am having issues with a shared github project our team is working on. I have been banging my head against this issue for about a week now without any luck.

The issue is a brand new clone that is working on my teams computers, will not run correctly on my computer. It throws the error, "Module AppRegistry is not a callable module". I am working on a ios project. I have deleted all folders and started again. I have created new users with various permissions and no luck.

Is there anything else that I am missing to try? Thanks!


Index.ios.js

const { AppRegistry } = require('react-native');
const setup = require('./app/setup');

AppRegistry.registerComponent('mobileapps', setup);

Setup.js

import App from './index';
import React, { Component } from 'react';
import { Provider } from 'react-redux';
import configureStore from './store';

const store = configureStore();

function setup() {
  class Root extends Component {
    render() {
      return (
        <Provider store={store}>
          <App />
        </Provider>
      );
    }
  }

  return Root;
}

module.exports = setup;
like image 660
gbland777 Avatar asked Jun 30 '16 20:06

gbland777


People also ask

Is not a registered callable module?

ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

What is AppRegistry Why is it required early in require sequence?

AppRegistry should be required early in the require sequence to make sure the JS execution environment is setup before other modules are required.

What is invariant violation in react native?

Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of 'App'.


1 Answers

Okay I figured it out after doing a new react-native init and installing each of my npm packages individually to see which one breaks. I found out it was RNCookies manager but the entire issue was I needed to run a rnpm link.

like image 80
gbland777 Avatar answered Oct 13 '22 22:10

gbland777



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!