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

Component fails to render after starting/initialising thread in iOS

Open ghost opened this issue 7 years ago • 2 comments

Hi, In my app i have a side-menu as well which works perfectly fine for the android app, but in iOS the side-menu fails to render anything as soon as I start the thread by calling this.thread = new Thread('Thread.js') Now i cannot even debug from React-native-debugger/remote debugging as using it will cause thread itself to throw error package manager is not running which is already an open issue. Is there something I am missing to initialise the app properly for iOS app.

ghost avatar Jul 02 '18 14:07 ghost

Sorry I have no idea what could be causing this issue. It could be that you have unrelated code that is trying to call methods on this.thread before it is defined, or some other error. Even if the JS code in your thread module crashes entirely, it is running in a completely separate process and would not have any impact on your main react native js ui.

Traviskn avatar Aug 23 '18 16:08 Traviskn

Something you could try is to wrap your thread instantiation code in a try/catch block and log the error with console.error so that you can see the message even without having remote debugging enabled:

try {
  this.thread = new Thread('Thread.js');
} catch (e) {
  console.error('ERROR INSTANTIATING THREAD: ', e); // depending on what sort of error is being thrown, you may need to pass e.message to console.error to get more valuable info
}

Traviskn avatar Aug 23 '18 16:08 Traviskn