Drawer navigator crashes with [Reanimated] Failed to create a worklet
[Reanimated] Failed to create a workletShort answer
The drawer needs react-native-gesture-handler, react-native-reanimated and react-native-worklets, and Reanimated's own Babel plugin. Failed to create a worklet means that setup is incomplete. Install the three packages, add the worklets plugin last in babel.config.js, clear the Metro cache, and rebuild the native app.
Fix it fast
1Find out which cause you have
List the three packages the drawer needs, and check the Babel config for the worklets plugin.
npm ls react-native-gesture-handler react-native-reanimated react-native-worklets cat babel.config.js2Match what you see, then jump to its fix
- 1
Failed to create a worklet, right after setup, with the packages installedThe Babel plugin is missing or not lastFix - 2
The Babel config is correct but the same error remainsMetro still serves code compiled before the config was fixedFix - 3
npm ls shows one of the three packages missing or UNMETA required drawer package is not installedFix - 4
Packages and Babel are correct, but the app was only reloadedThe native app was not rebuilt after installingFix - 5
The app is on the old architecture and uses Reanimated 4Reanimated 4 on an app that is not on the New ArchitectureFix
- 1
What does the error look like?
[Reanimated] Failed to create a workletMismatch between JavaScript code version and Worklets Babel plugin version
Cause 1 of 5
The Babel plugin is missing or not last
1Check
Reanimated's troubleshooting guide says this error usually comes from an incomplete install, with the Worklets Babel plugin missing from babel.config.js as the example. Expo's starter template already has it, a bare project does not.
grep -n "worklets" babel.config.js2Fix
Add the plugin as the last entry in the plugins list.
// babel.config.js
module.exports = {
// keep your existing presets here
plugins: ['react-native-worklets/plugin'], // keep this last
};3Verify
Restart Metro with a cleared cache and open the drawer.
npm start -- --reset-cacheConfirmed by docs.swmansion.com
Cause 2 of 5
Metro still serves code compiled before the config was fixed
1Check
The guide says that when the plugin is set up properly, a stale Metro cache is the next thing to rule out.
grep -n "worklets/plugin" babel.config.js2Fix
Reset the cache when starting Metro, then run the app again.
npm start -- --reset-cache
# Expo
npx expo start -c3Verify
Reload the app; the drawer should render and open.
npm start -- --reset-cacheConfirmed by docs.swmansion.com
Cause 3 of 5
A required drawer package is not installed
1Check
The drawer navigator page lists react-native-gesture-handler, react-native-reanimated and react-native-worklets as required.
npm ls react-native-gesture-handler react-native-reanimated react-native-worklets2Fix
Install all three. In Expo use expo install so versions match the SDK.
# Expo
npx expo install react-native-gesture-handler react-native-reanimated react-native-worklets
# bare
npm install react-native-gesture-handler react-native-reanimated react-native-worklets3Verify
npm ls shows all three with no errors.
npm ls react-native-gesture-handler react-native-reanimated react-native-workletsConfirmed by reactnavigation.org
Cause 4 of 5
The native app was not rebuilt after installing
1Check
Reanimated has native code. Expo needs prebuild to update ios and android, and iOS needs pod install.
ls ios/Pods | grep -i -E "reanimated|worklets"2Fix
Update the native projects and build the app again.
# Expo
npx expo prebuild
# bare iOS
cd ios && pod install && cd ..3Verify
Run the new native build and open the drawer.
ls ios/Pods | grep -i -E "reanimated|worklets"Confirmed by docs.swmansion.com
Cause 5 of 5
Reanimated 4 on an app that is not on the New Architecture
1Check
Reanimated 4 works only with the New Architecture. Apps on the old one can use Reanimated 3, which the docs say is no longer actively maintained.
npm ls react-native-reanimated2Fix
Move the app to the New Architecture, or install Reanimated 3 and follow its own setup page.
npm install react-native-reanimated@33Verify
Rebuild the native app and open the drawer.
npm ls react-native-reanimatedConfirmed by docs.swmansion.com
How do I stop it coming back?
- Follow the Reanimated install page in order, including the cache reset and native rebuild.
- Use expo install in Expo so package versions match the SDK.
- Keep the Babel plugin as the last entry in the list.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- stegnor.comMy company site: 804 pages from a Python and Jinja generator, with 15 free browser tools.
Related fixes
Mobile apps
TurboModuleRegistry: 'NativeReanimated' could not be found
Native part of Reanimated doesn't seem to be initialized
This means the JavaScript of react-native-reanimated loaded but its native code is not in the app binary.
3 causes, each with a fixMobile apps
Android build stops at processDebugManifest in a React Native app
Manifest merger failed
processDebugManifest is the step that merges your AndroidManifest.xml with the manifests of every library.
2 causes, each with a fixMobile apps
Running pod on a React Native project fails with can't find gem cocoapods
can't find gem cocoapods (>= 0.a) with executable pod
The pod command exists, but the Ruby that is running it has no CocoaPods gem.
3 causes, each with a fixMobile apps
React Native Android build cannot find the foojay-resolver-convention plugin
Plugin [id: 'org.gradle.toolchains.foojay-resolver-convention'] was not found in any of the following sources:
The foojay plugin is a settings plugin that Gradle downloads from the Plugin Portal.
3 causes, each with a fixMobile apps
Kotlin and Java compile to different JVM targets in a React Native Android build
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11)
Gradle refuses to build when the Java task and the Kotlin task target different JVM versions.
3 causes, each with a fixMobile apps
Gradle cannot run node in a React Native Android build
Process 'command 'node'' finished with non-zero exit value 1
The React Native Gradle plugin starts node for bundling.
3 causes, each with a fix