react-native-keyboard-controller: failed to create a worklet - when importing KeyboardProvider

Describe the bug I installed the library and a Screenshot 2023-12-18 at 10 15 00 dded a swift file. When I run the app every things work than I try to import the KEyboardProvider and I get this error

Code snippet <KeyboardProvider statusBarTranslucent> <SafeAreaProvider> <Toaster /> <Navigation /> </SafeAreaProvider> </KeyboardProvider>

To Reproduce Steps to reproduce the behavior: npm install react-native-keyboard-controller pod install swift file in xcode run ios import KeyboardProvider

Expected behavior App run without

Screenshots Screenshot 2023-12-18 at 10 15 00 error

Smartphone (please complete the following information):

  • Desktop OS: [e.g. Windows 10, MacOS 10.15.5]
  • Device: [e.g. iPhone8]
  • OS: [e.g. iOS 10.0]
  • RN version: [e.g. 0.68.2]
  • RN architecture: [e.g. old/new or paper/fabric]
  • JS engine: [e.g. JSC, Hermes, v8]
  • Library version: [e.g. 1.2.0]

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 16 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Actually I thought a little bit more and decided, that for now I’ll close the issue - now it’s mandatory to install reanimated.

Maybe in future I’ll revisit the approach and make the reanimated dependency optional, but right now all components (KeyboardAvoidingView, KeyboardAwareScrollView and KeyboardStcikyView) are using and heavily rely on reanimated, so I’ll keep it mandatory and close the issue.

Thanks @pouyaemami and @ShaulBenDavid for your reports and help to resolve the problem 💪

I know that your package brings it in as a dependency but for some reason, running pod install doesn’t install doesn’t install react-native-reanimated when I only have your package as a direct dependency for my project. Not sure if I missed something in the setup guide you have.

No, I believe you did everything correctly - for some reasons I missed this info in my installation guide 🙈 I’ll fix it shortly 👍

In react-native world declaring something as peerDependency will not add it in Pod and will not link it natively, so yeah, react-native-reanimated has to be declared in your app dependencies.

Thank you for your comments and I’m glad you finally managed to make everything working! 💪