ammarahm-ed / react-native-jsi-template

Template library and blog that explain how JSI modules are built from scratch in React Native
https://blog.notesnook.com/getting-started-react-native-jsi/
MIT License
162 stars 24 forks source link

global.helloWorld is undefined (iOS) #3

Open hemgui opened 3 years ago

hemgui commented 3 years ago

I'm using RN 0.63.4 (last version) I followed the getting started here https://blog.notesnook.com/getting-started-react-native-jsi/ and pretty new to the iOS world.

There's no build issue (from xcode 12.5 and from the command line react-native run-ios) when building the example app. But I get an execution error on the first call of the JSI setResult(global.helloWorld()) - global.helloWorld is undefinded I have add a log in the installLibrary method in the SimpleJsi.mm file but never see it.

Did I miss something in XCode, to make the react-native-simple-jsi library used in the example App (i see it in the library in development Pods) ?

After few retry at the begining of the tutorial, i'm still stuck with this error.

Any help would be appreciate ^^

Thanks in advance.

ammarahm-ed commented 3 years ago

I'm using RN 0.63.4 (last version) I followed the getting started here https://blog.notesnook.com/getting-started-react-native-jsi/ and pretty new to the iOS world.

There's no build issue (from xcode 12.5 and from the command line react-native run-ios) when building the example app. But I get an execution error on the first call of the JSI setResult(global.helloWorld()) - global.helloWorld is undefinded I have add a log in the installLibrary method in the SimpleJsi.mm file but never see it.

Did I miss something in XCode, to make the react-native-simple-jsi library used in the example App (i see it in the library in development Pods) ?

After few retry at the begining of the tutorial, i'm still stuck with this error.

Any help would be appreciate ^^

Thanks in advance.

A quick guess would be to check your header files in the module you created. You might have missed something there. setBridgeOnMainQueue property in SimpleJsi.h file.

Also try running this library in your project and see if it works or not.