Reputation: 83
I start working on the app from my site (ReactJS + Redux + Express), and I want to use the same backend and database for the app and the site. Now decide to reuse most of my ReactJS code, since I understand I can use the same function. I created the Redux store in my main folder, but at building time it doesn't work and it gave me the following errors:
ERROR TypeError: undefined is not a function, js engine: hermes
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., js engine: hermes
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., js engine: hermes
I tried every single store layout, but it seem not to work. I can't even connect the RNDebugger to the app. Here's my store:
import {createStore, applyMiddleware, compose} from 'redux';
import {thunk} from 'redux-thunk';
import rootReducer from './src/reducers';
const initialState = {};
const middleware = [thunk];
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
rootReducer,
initialState,
composeEnhancers(
applyMiddleware(...middleware),
),
);
export default store;
And my App.js :
import React from 'react';
import {NavigationContainer} from '@react-navigation/native';
import DrawerNavigator from './src/routes/DreawerNavigator';
import {Provider} from 'react-redux';
import store from './store';
export default function App() {
return (
<Provider store={store}>
<NavigationContainer>
<DrawerNavigator />
</NavigationContainer>
</Provider>
);
}
Anyone could please explain to me why it doesn't works and how I can connect the RNDebugger to my app?
EDIT: I figured out the error is located in the store.js file, when I comment the const store = ...
the app back to work. Really don't understand why
Upvotes: 0
Views: 410