I am using react native expo's latest SDK. While using the react-native-in-app-notification
package I am getting the following error,
ERROR TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.source')
ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.unmountApplicationComponentAtRootTag(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter.
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an e ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered
callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerform A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
Please help me...
CodePudding user response:
proptTypes
is removed from react-native
, which results unmaintained packages having these issues.
You can either fork that repo then apply changes & use your forked repo or
follow below method to patch-package
with fixes in package.
- Open
node_modules/react-native-in-app-notification
- Apply changes to corresponding files mentioned in this PR : Resolve type errors
- From root of your project run
npm i patch-package
(patch-package) - Run
npx patch-package react-native-in-app-notification
(This will create a patch file with changes in node_modules file of your package) - Add
"postinstall": "patch-package"
underscripts
inpackage.json
to automatically runpatch-package
and apply changes afternpm install