After updating to expo 52: ReferenceError: _WORKLET | __reanimatedLoggerConfig is not defined #6740
Open
Description
Description
After updating to Expo SDK 52, I encountered a ReferenceError: _WORKLET is not defined error on web platform. This error occurred after running expo install --fix to update dependencies. The error prevents the application from running properly on web.
Relevant dependencies:
{
"dependencies": {
"expo": "~52.0.0",
"react-native-reanimated": "~3.6.1",
"@react-native-community/slider": "4.5.5",
"@gorhom/bottom-sheet": "^5.0.5",
"@gorhom/portal": "~1.0.14"
}
}
// packages/expo-audio-ui/src/AnimatedCandle/AnimatedCandle.tsx
import { Rect } from '@shopify/react-native-skia'
import React, { useEffect } from 'react'
import { Platform } from 'react-native'
import { useSharedValue, withTiming } from 'react-native-reanimated'
import { CANDLE_OFFCANVAS_COLOR } from '../constants'
export interface AnimatedCandleProps {
height: number
x: number
y: number
startY: number
width: number
color: string
animated?: boolean
}
const AnimatedCandle: React.FC<AnimatedCandleProps> = ({
color: targetColor,
x: targetX,
y: targetY,
startY,
height: targetHeight,
width,
animated = true,
}) => {
const y = useSharedValue(startY)
const height = useSharedValue(0)
const x = useSharedValue(targetX)
const color = useSharedValue(CANDLE_OFFCANVAS_COLOR)
useEffect(() => {
if (Platform.OS === 'web') {
y.value = targetY
height.value = targetHeight
x.value = targetX
color.value = targetColor
return
}
if (animated) {
y.value = withTiming(targetY, { duration: 500 })
height.value = withTiming(targetHeight, { duration: 500 })
x.value = withTiming(targetX, { duration: 500 })
color.value = withTiming(targetColor, { duration: 500 })
} else {
y.value = targetY
height.value = targetHeight
x.value = targetX
color.value = targetColor
}
}, [targetY, targetHeight, targetX, targetColor, animated])
return <Rect x={x} y={y} width={width} height={height} color={color} />
}
export default React.memo(AnimatedCandle)
Steps to reproduce
on Web it seems that using any wtihTiming creates the issue.
Snack or a link to a repository
https://github.com/deeeed/expo-audio-stream/blob/main/apps/playground/src/app/minimal.tsx
Reanimated version
3.6.1
React Native version
0.76.2
Platforms
Android, iOS, Web
JavaScript runtime
Hermes
Workflow
Expo Dev Client
Architecture
Fabric (New Architecture)
Build type
Debug app & dev bundle
Device
Real device
Device model
iphone pro 13
Acknowledgements
Yes