Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tap gesture example crashes in Expo Go #2667

Closed
henrymoulton opened this issue Nov 3, 2023 · 5 comments · Fixed by #2670
Closed

Tap gesture example crashes in Expo Go #2667

henrymoulton opened this issue Nov 3, 2023 · 5 comments · Fixed by #2670
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided

Comments

@henrymoulton
Copy link

henrymoulton commented Nov 3, 2023

Description

Simulator.Screen.Recording.-.iPhone.14.-.2023-11-03.at.03.07.54.mp4

Steps to reproduce

  1. Copy in code from https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/tap-gesture#example
  2. npx create-expo-app --template
  3. npx expo install react-native-reanimated react-native-gesture-handler
  4. paste in code
  5. tap on view
  6. watch it crash

Snack or a link to a repository

https://gist.github.com/henrymoulton/3f86a2a781f7bb1c814e2ff8b8c0400a
https://snack.expo.dev/@henry12345678/courageous-green-truffles?platform=ios

Gesture Handler version

"2.12.1"

React Native version

0.72.6

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Expo managed workflow

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

iOS simulator

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Missing repro Platform: iOS This issue is specific to iOS labels Nov 3, 2023
@henrymoulton
Copy link
Author

@github-actions github-actions bot added Repro provided A reproduction with a snack or repo is provided and removed Missing repro labels Nov 3, 2023
@m-bert
Copy link
Contributor

m-bert commented Nov 6, 2023

Hi @henrymoulton! I've tested that and I have not noticed any crash. I've done it by doing the following steps:

  1. npx create-expo-app --template
    1.1. blank (TypeScript)
  2. npx expo install react-native-gesture-handler
  3. npx expo start
    3.1. press i to run iOS simulator

I'm using simulator iPhone 15 Pro with iOS 17.0. I've also checked that on physical device with android.

Notice that I didn't use react-native-reanimated - there were some problems with babel plugin. Please check that and if there's still problem with gesture handler prepare a repo with reproduction.

@henrymoulton
Copy link
Author

henrymoulton commented Nov 6, 2023

Hey @m-bert thanks for the reply and attempt to recreate :). Hmm weird, I've got a reproduction of the crash using Snack, can you verify that it crashes in the Snack provided for you?

lol.mov

@m-bert
Copy link
Contributor

m-bert commented Nov 6, 2023

It does crash on snack, however we had many cases where something doesn't work on snack but works on other devices (physical, emulators/simulators) - that's why we double-check everything outside of snack.

@m-bert
Copy link
Contributor

m-bert commented Nov 6, 2023

Okay, I've just got rid of that babel error. The app indeed crashed. Moreover it will crash outside of Expo Go.

This is due to Alert.alert. Our callback are workletized and there's no access to Alert on UI thread. To make this work, you would have to add .runOnJS(true) - then app won't crash. We will change it in our documentation soon.

m-bert added a commit that referenced this issue Nov 6, 2023
## Description

Some examples in our docs use `Alert.alert`, even though callbacks in new api are automatically workletized. They won't work, because there's no way to access `Alert` on UI thread.

Fixes #2667 

## Test plan

Checked that both `LongPress` and `Tap` pages were updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snack or repo is provided
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants