Description
When upgrading react-native-gesture-handler from 2.25.0 to 2.28.0 on React Native 0.80, our app crashes with the following error:
ReanimatedError: Cannot read property 'LEFT' of undefined, js engine: reanimated. Cannot read LEFT of undefined
The error points to the TypeScript enum:
export enum SwipeDirection {
LEFT = 'left',
RIGHT = 'right',
}
This enum usage is standard and works fine elsewhere in our codebase. After upgrading, it fails specifically in this context, referencing the SwipeDirection enum. Enums work as expected elsewhere.
The only thing that I can think of is that we use unstable_enablePackageExports and unstable_conditionNames in our metro.config
resolver: {
assetExts: assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...sourceExts, 'svg', 'mjs', 'cjs'],
// disable watchman for now, its just too slow and unstable
useWatchman: false,
// This needs to be here for react-strict-dom to work
unstable_enablePackageExports: true,
unstable_conditionNames: ['react-native', 'require', 'default'],
},
Steps to reproduce
- Upgrade react-native-gesture-handler from 2.25.0 to 2.28.0
- Use
react-native-gesture-handler/ReanimatedSwipeable
A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
none
Gesture Handler version
2.28.0 (upgraded from 2.25.0)
React Native version
0.80
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Old Architecture (Paper)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
Description
When upgrading react-native-gesture-handler from 2.25.0 to 2.28.0 on React Native 0.80, our app crashes with the following error:
ReanimatedError: Cannot read property 'LEFT' of undefined, js engine: reanimated. Cannot read LEFT of undefinedThe error points to the TypeScript enum:
This enum usage is standard and works fine elsewhere in our codebase. After upgrading, it fails specifically in this context, referencing the SwipeDirection enum. Enums work as expected elsewhere.
The only thing that I can think of is that we use
unstable_enablePackageExportsandunstable_conditionNamesin ourmetro.configSteps to reproduce
react-native-gesture-handler/ReanimatedSwipeableA link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.
none
Gesture Handler version
2.28.0 (upgraded from 2.25.0)
React Native version
0.80
Platforms
iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Old Architecture (Paper)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes