Open ansh opened 1 year ago
@EvanBacon It's weird that this crash only happens when I use expo-dev-client
and not when I use Expo Go with the same versions of everything (repro provided above). Tagging you in case you know something about this.
@ansh did you get any solution? I am getting same error.
We are seeing the same issue here. Anyone found a solution?
It got resolved after running watchman watch-del-all
and yarn start --reset-cache
Doesn't seem to fix it in our case
It got resolved after running
watchman watch-del-all
andyarn start --reset-cache
that did not work for me either.. 😢
I have narrowed it down to be because I'm doing some runOnJS(feedback)({ skipPlatform: ['web'] })
to trigger haptic feedback. It worked a while for me to convert the gesture to do .runOnJS(true)
const feedback = (options?: { skipPlatform?: (typeof Platform.OS)[] }) => {
if (options?.skipPlatform?.includes(Platform.OS)) return
try {
throttleFeedback()
} catch (error) {
Sentry.Native.captureMessage('failed JS thread (haptic) feedback on Chart', 'warning')
}
}
const panGesture = Gesture.Pan()
.runOnJS(true) // https://docs.swmansion.com/react-native-gesture-handler/docs/2.3.0/api/gestures/pan-gesture/#runonjsvalue-boolean
.onBegin((event) => {
scrollX.value = event.absoluteX
labelViewOpacity.value = 1
pointDate.value = processedData[index.value].date
pointValue.value = processedData[index.value].value
feedback({ skipPlatform: ['web'] })
})
but now that does not seem to work any more. 🤷♂️
I have solved it by not calling it in development mode by a conditional barrel export
import { hapticFeedback as feedbackDevelopment } from './index.development' // just a () => {}
import { hapticFeedback as feedbackProduction } from './index.production'
const hapticFeedback = __DEV__ ? feedbackDevelopment : feedbackProduction
export { hapticFeedback }
We are not using runOnJS anywhere in our codebase but are still experiencing this issue.
@Norfeldt Sorry, I do not understand. You solved it by not calling what in development mode? What was your version of reanimated? What were the steps you took?
@ansh is this the information you need?
const panGesture = Gesture.Pan()
.runOnJS(true)
.minDistance((Layout.window.width - 2 * Layout.safeHorizontalPadding) / 200)
.onBegin((event) => {
scrollX.value = event.absoluteX
labelViewOpacity.value = 1
pointDate.value = processedData[index.value].date
pointValue.value = processedData[index.value].value
hapticFeedback({ skipPlatform: ['web'] })
})
.onUpdate((event) => {
scrollX.value = event.absoluteX
// can't use useDerivedValue since it does not have access to own values (lastTwoIndexes.value[1])
lastTwoIndexes.value = [lastTwoIndexes.value[1] ?? 0, index.value]
if (lastTwoIndexes.value[0] !== lastTwoIndexes.value[1]) {
pointDate.value = pData.value[index.value].date
pointValue.value = processedData[index.value].value
hapticFeedback({ skipPlatform: ['android'] }) // android haptic feedback vibration is too much
Platform.select({
web: forceUpdate,
})
}
})
.onFinalize(() => {
labelViewOpacity.value = 0
hapticFeedback({ skipPlatform: ['web'] })
})
package.json
"expo": "^47.0.12",
"expo-dev-client": "~2.0.1",
"react-native-gesture-handler": "~2.8.0",
"react-native-reanimated": "~2.12.0",
I have attempted to make a snack once, but that was not able to reproduce the error that was causing it to crash.
Same error with latest versions:
"react-native-gesture-handler": "2.9.0",
"react-native-reanimated": "3.2.0",
I've also been experiencing this for some time and wonder if there are any updates on the topic?
having same issue as well.
This seems to be happening with CodePush updates too in case anyone tracks down this issue.
Edit: Updating to v3 of reanimated fixes my issue.
Received the same error with a different stack trace. Beta app fails on startup, although the splash screen does popup ever so briefly.
Description
A video of the crash happening https://user-images.githubusercontent.com/8207733/210131053-51c7ff0a-d9ee-4b10-80a0-1f10c0e273b7.mp4
The error I get after the crash
Full error text: https://textbin.net/apakzpco91
I have tried 3.0.0-rc.9 and rc.8 and they kind of reduce the probability of issue but they do not fix it. Also, they introduce another bug shown below. So basically, they just make the crash non-deterministic.
Steps to reproduce
npx create-expo-app
to create a new Expo appreanimated
+expo-dev-client
npx expo prebuild
+npx expo run:ios
Snack or a link to a repository
https://github.com/ansh/reanimated-reload-crash
Reanimated version
2.12.0
React Native version
0.70.5
Platforms
iOS
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
iOS simulator
Device model
No response
Acknowledgements
Yes