'"Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin" when using createDrawerNavigator()

I get this error

Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added to [HasteMap]. Use emitter.setMaxListeners() to increase limit (Use node --trace-warnings ... to show where the warning was created)

ERROR Error: Requiring module "node_modules/@react-navigation/drawer/src/index.tsx", which threw an exception: Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin?

With this code

import { createDrawerNavigator } from '@react-navigation/drawer';
const Drawer = createDrawerNavigator();

I am using

"@react-navigation/drawer": "^5.12.4",
"@react-navigation/native": "^5.9.3",
"react-native": "0.63.4",

Why is it throwing the error?



Solution 1:[1]

If you are using expo follow the instructions here: https://docs.expo.dev/versions/latest/sdk/reanimated/#installation

This solves the issue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eliav Menachi