Invariant Violation: "main" has not been registered.
Current behavior
When loading an app via Expo Go, the following error occurs:
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.
at node_modules\react-native\Libraries\LogBox\LogBox.js:149:8 in registerError
at node_modules\react-native\Libraries\LogBox\LogBox.js:60:8 in errorImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:34:4 in console.error
at node_modules\expo\build\environment\react-native-logs.fx.js:27:4 in error
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:104:6 in reportException
at node_modules\react-native\Libraries\Core\ExceptionsManager.js:172:19 in handleException
at node_modules\react-native\Libraries\Core\setUpErrorHandling.js:24:6 in handleError
at node_modules\@react-native\polyfills\error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:367:8 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:112:4 in callFunctionReturnFlushedQueue
This happens when adding the library to a previously working application.
Expected behavior
The following code was added to the app:
import { Image } from 'react-native-compressor';
const result = await Image.compress('file://path_of_file/image.jpg', {
compressionMethod: 'auto',
});
The app should load normally and reach the point of execution.
Platform
- [X] Android
- [X] iOS
React Native Version
0.64.3
React Native Compressor Version
^1.5.2
👋 @kmandalas Thanks for opening your issue here! If you find this package useful hit the star🌟!
I'm also getting this error.
The same error as well,
I'm also getting this error.
Hi, did anyone manage to solve this, I'm still getting this error in iOS. Thank you.
can you try 1.8.5