question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reanimated global.__reanimatedWorkletInit is not a function

See original GitHub issue

Describe the bug

When i try use library with Expo, the follow message shows

TypeError: global.__reanimatedWorkletInit is not a function. (In 'global.__reanimatedWorkletInit(_f)', 'global.__reanimatedWorkletInit' is undefined)

If i put the code

global.__reanimatedWorkletInit = () => {};

on '…/lib/commonjs/utils/dealWithAnimation.js works correctly

To Reproduce Steps to reproduce the behavior:

  1. Install library and try use
  2. See error

Screenshots image

Versions:

  • expo: ~45.0.0
  • react: v17.0.2
  • react-native: v0.68.1
  • react-native-reanimated: v^2.8.0
  • react-native-reanimated-carousel: v^2.3.10
  • react-native-gesture-handler: v~2.2.0

Smartphone:

  • Device: iPhoneXR
  • OS: iOS 15.4

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:33 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
thanhtrung07commented, May 19, 2022

I add global.__reanimatedWorkletInit = () => { }; to \node_modules\react-native-reanimated\src\Animated.js and the issue gone

import * as reanimated1 from './reanimated1';
import ReanimatedComponents from './reanimated2/component';

global.__reanimatedWorkletInit = () => { }; // <--- add this line

const Animated = {
  // components
  ...ReanimatedComponents,
  createAnimatedComponent,
  // configuration
  addWhitelistedNativeProps,
  addWhitelistedUIProps,
  // reanimated 1
  ...reanimated1,
};
4reactions
SimonDambergcommented, May 12, 2022

Same here!

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: global.__reanimatedWorkletInit is not a function. (In ...
I am using React Native (not expo). I don't even have reanimated downloaded. I had it downloaded then I removed it and rebuilt...
Read more >
TypeError: global.__reanimatedWorkletInit is not a ... - GitHub
Description error when running tests Snack or minimal code example ○ Test suite failed to run TypeError: global.__reanimatedWorkletInit is not a function ...
Read more >
r.g.__reanimatedWorkletInit is not a function in expo snack
react native reanimated error r.g.__reanimatedWorkletInit is not a function. My apps is correctly working on my laptop. I am using VScode editor ...
Read more >
execution failed for task ':react-native-reanimated ... - You.com
__reanimatedWorkletInit is not a function. ... After Adding react-native-reanimated library in React Native 0.70.0 we are getting below issue in Window 10:.
Read more >
global.__reanimatedWorkletInit is not a function. react-native ...
[Solved]-global.__reanimatedWorkletInit is not a function. react-native-animated v2-React Native. Search.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found