facebook / hermes

A JavaScript engine optimized for running React Native.
https://hermesengine.dev/
MIT License
9.91k stars 641 forks source link

Thread 6: "Exception NSException * "Unhandled JS Exception: Error: invalid host, js engine: hermes" #1228

Closed hacnam0306 closed 5 months ago

hacnam0306 commented 10 months ago
image

*Thread 6: "Exception NSException "Unhandled JS Exception: Error: invalid host, js engine: hermes" when building release schema with react native 0.70.2** It's only occur in release mode , when debugging it's run normally

tmikov commented 10 months ago

Hi, I am sorry you are having this problem, but unfortunately your report doesn't provide enough information to diagnose it, or even to identify that Hermes is the culprit. Unless you can provide a detailed reproduction with the latest version of Hermes, there is not much we can do.

karam1ashqar commented 10 months ago

same thing happening to me, only in RELEASE, react native app, it happens whenever i try to launch the app, always crashing on launch,

any update your end ? @hacnam0306

"Unhandled JS Exception: Error: invalid host, js engine: hermes"

hacnam0306 commented 10 months ago

same thing happening to me, only in RELEASE, react native app, it happens whenever i try to launch the app, always crashing on launch,

any update your end ? @hacnam0306

"Unhandled JS Exception: Error: invalid host, js engine: hermes"

same bro

Abramovick commented 10 months ago

Also been having the same issue, anyone figured out the solution?

tmikov commented 10 months ago

Note that this exception is coming from React Native, not Hermes. AFACT, it is thrown from one of these locations:

I recommend trying with the latest versions of RN and asking in React Native.

luanlcampos commented 10 months ago

Same problem here using RN 0.73.1. Any news on that issue?

karam1ashqar commented 10 months ago

It was an npm issue for me, I had npm install with --force or legacy peer reps to fix it

matheusPcruz18 commented 10 months ago

same thing happening to me, only in RELEASE, react native app, it happens whenever i try to launch the app, always crashing on launch,

any update your end ? @hacnam0306

"Unhandled JS Exception: Error: invalid host, js engine: hermes"

Same issue here, RN 0.71.14. Only on production IOS.

hacnam0306 commented 10 months ago

hi guys , i fixed it randomly by remove some useless library , checkout the version of reanimated , clean project by delete yarn.lock & node module and reinstall again <3

nishadthajudeen001 commented 10 months ago

hacnam0306 Any further update on this? can you please share more details on this -? useless library , checkout the version of reanimated

nishadthajudeen001 commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

liylmn commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

Could you please elaborate on the same issue,thanks @nishadthajudeen001

nishadthajudeen001 commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

Could you please elaborate on the same issue,thanks @nishadthajudeen001

Only the Release version APP was crashing with this error for us -"Error: invalid host, js engine: hermes",

This issue got resolved when we took the release after commenting out the Reactotron code.

liylmn commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

Could you please elaborate on the same issue,thanks @nishadthajudeen001

Only the Release version APP was crashing with this error for us -"Error: invalid host, js engine: hermes",

This issue got resolved when we took the release after commenting out the Reactotron code.

bro, thank you so much. Just delete these few libraries reactotron-react-native reactotron-redux reactotron-redux-saga

vinesh4Real commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

Could you please elaborate on the same issue,thanks @nishadthajudeen001

Only the Release version APP was crashing with this error for us -"Error: invalid host, js engine: hermes", This issue got resolved when we took the release after commenting out the Reactotron code.

bro, thank you so much. Just delete these few libraries reactotron-react-native reactotron-redux reactotron-redux-saga

I can confirm. Removing reactotron and reactotron related libraries fixed it.

Ajmal0197 commented 10 months ago

Reactotron was causing the issue in release mode, I was able to fix that by commenting out the reactotron code during the release build.

Could you please elaborate on the same issue,thanks @nishadthajudeen001

Only the Release version APP was crashing with this error for us -"Error: invalid host, js engine: hermes", This issue got resolved when we took the release after commenting out the Reactotron code.

bro, thank you so much. Just delete these few libraries reactotron-react-native reactotron-redux reactotron-redux-saga

I can confirm. Removing reactotron and reactotron related libraries fixed it.

After wasting whole day your soln worked. Any way to keep reactotron also and app crash free

Ajmal0197 commented 10 months ago

There is no need for library uninstallation, for now I am manually commenting or uncommenting every reactotron instance during release or debug mode.

tmikov commented 10 months ago

So, this looks like a problem in Reactotron? @Ajmal0197 I see you reported it to Infinite Red, but then closed the issue?

Ajmal0197 commented 10 months ago

So, this looks like a problem in Reactotron? @Ajmal0197 I see you reported it to Infinite Red, but then closed the issue?

It's temporarily solved will reopen it. Forgot to reopen.

vinesh4Real commented 10 months ago

@Ajmal0197 @tmikov I managed to solve it. Make sure you dont import anything unless you are in development mode.

In our entry file, we were careful to import our reactotron config file (has all the tron config and imports) only if we are in dev mode. Like so,

if (__DEV__) {
  import('./ReactotronConfig').then(() =>
    // eslint-disable-next-line no-console
    console.tron.log('Reactotron Configured'),
  );
}

But we were also using redux enhancers in our redux store declaration, where the import existed regardless of the environment. This is where the error was from. I solved it by importing only after confirming dev environment,

let getEnhancers = () => {
  if (process.env.NODE_ENV === 'development') {
    const reactotron = require('../../ReactotronConfig').default;
    [reactotron.createEnhancer!()];
  }
  return [];
};

const store = configureStore({
  reducer: rootReducer,
  enhancers: getEnhancers(),
});
Ajmal0197 commented 10 months ago

let getEnhancers = () => { if (process.env.NODE_ENV === 'development') { const reactotron = require('../../ReactotronConfig').default; [reactotron.createEnhancer!()]; } return []; };

This worked for me thanks:

const getEnhancers = (getDefaultEnhancers) => {
  if (process.env.NODE_ENV === 'development') {
    const reactotron = require('../helpers/ReactotronConfig').default;
    return getDefaultEnhancers().concat(reactotron.createEnhancer());
  }
  return getDefaultEnhancers();
};

// https://redux-toolkit.js.org/usage/usage-guide#use-with-redux-persist
const store = configureStore({
  reducer: persistedReducer,
  middleware: (getDefaultMiddleware) =>
    getDefaultMiddleware({
      serializableCheck: {
        ignoredActions: [FLUSH, REHYDRATE, PAUSE, PERSIST, PURGE, REGISTER], //
      },
    }),
  enhancers: getEnhancers,
});
lachu97 commented 10 months ago

SIGABRT: Unhandled JS Exception: Error: invalid host, js engine: hermes I too getting this same error,that too only in production..I tried it using iphone SE ios version 17+

vinesh4Real commented 10 months ago

@Ajmal0197 Dont you need to call that function?

Ajmal0197 commented 10 months ago

@Ajmal0197 Dont you need to call that function?

Already calling see last line. Also u can follow this https://github.com/infinitered/reactotron/issues/1398

vinesh4Real commented 10 months ago

@Ajmal0197 that's what I mean, you assigned it but its not called. Add open close brackets getEnhancers()

Ajmal0197 commented 10 months ago

@Ajmal0197 that's what I mean, you assigned it but its not called. Add open close brackets getEnhancers() Se

We can use like this in es6. It's working i have checked properly in release/debug mode

matheusPcruz18 commented 10 months ago

I just removed all reactotron code from my project and it worked. Thank you guys.

nishadthajudeen001 commented 10 months ago

check this link https://github.com/infinitered/reactotron/issues/1398, latest build 5.0.4 is the culprit for the issue. We will continue to comment out when we take release build still reactotron resolve the issue

TrustDec commented 10 months ago

Change reactotron-react-native in package.json to 5.0.3, instead of ^5.0.3, otherwise the actual version of reactotron-react-native in node_modules is 5.0.4

sebasgarcia29 commented 10 months ago

Hello, I remove the dependencies from reactotron-react-native, reactotron-redux, reactotron-redux-saga and reactotron-plugin-zustand works for me, thank you for advices @nishadthajudeen001 !

OmarUsman777 commented 9 months ago

I have removed the reactotron configuration from my app, Now it shows blank screen, when i quit the app and start it agian it works fine. But for the first time why is it showing the blank screen?

P.S: This issue is only caused when i try to release the ios app.

Ajmal0197 commented 9 months ago

✅ ✅ ✅ This is solution for now: https://github.com/infinitered/reactotron/issues/1398#issuecomment-1913913058

SanjayKdotpitch commented 5 months ago

Error: Storage for resolved schema shoutem.core.users doesn't exists in state., js engine: hermes any solution this error

tmikov commented 5 months ago

Closing, since after all of this discussion no evidence has emerged pointing to a Hermes problem. (Discussion can continue, the issue isn't locked).

allenben746 commented 1 month ago

Running into this issue, but I'm not using reactotron in my project. Will update this ticket with my findings.

yz-xlame commented 1 month ago

I am not using reactotron, but I am also encountering this issue.