react-native-compressor icon indicating copy to clipboard operation
react-native-compressor copied to clipboard

Invariant Violation: "main" has not been registered.

Open kmandalas opened this issue 3 years ago • 4 comments

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 avatar Apr 28 '22 12:04 kmandalas

👋 @kmandalas Thanks for opening your issue here! If you find this package useful hit the star🌟!

github-actions[bot] avatar Apr 28 '22 12:04 github-actions[bot]

I'm also getting this error.

laffan avatar Jul 13 '22 23:07 laffan

The same error as well,

marekStef avatar Sep 15 '22 11:09 marekStef

I'm also getting this error.

jdembi avatar Sep 28 '22 21:09 jdembi

Hi, did anyone manage to solve this, I'm still getting this error in iOS. Thank you.

DFRZ7 avatar Jan 31 '23 06:01 DFRZ7

can you try 1.8.5

numandev1 avatar Sep 26 '23 18:09 numandev1