react-native-reanimated
react-native-reanimated copied to clipboard
TypeError: window.matchMedia is not a function
Description
Hi!. When I try to run a development build using the npx expo run:ios command and I use a component that uses react-native-reanimated I receive an error:
ERROR TypeError: window.matchMedia is not a function (it is undefined), js engine: hermes ERROR Invariant Violation: "main" has not been registered. This can happen if:
- Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
- A module failed to load due to an error and
AppRegistry.registerComponent
wasn't called., js engine: hermes
Do you have any idea what I'm doing wrong?
I tried changing the reanimated versions but it didn't help. I have the impression that the error appeared suddenly because there was no problem with this version before.
I have never had such problems using Reanimated before.
Steps to reproduce
- Run npx expo run:ios
- Import/use component using react-native-reanimated.
Snack or a link to a repository
https://github.com/software-mansion/react-native-reanimated
Reanimated version
3.6.2
React Native version
0.73.5
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
Expo Dev Client
Architecture
None
Build type
Debug app & dev bundle
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
Hello @zajecvolk 👋 We always encourage bumping Reanimated to the newest versions - currently stable one is 3.8.1. Apart from that I would recommend to make a all-caches reset using git clean -xdf
in repo root - it deletes all untracked files being node_modules
, Pods
, etc.. When done with that, the Pods should now be installed by running bundle install && bundle exec pod install
. Let me know if anything changes for you!
Hello @zajecvolk 👋 We always encourage bumping Reanimated to the newest versions - currently stable one is 3.8.1. Apart from that I would recommend to make a all-caches reset using
git clean -xdf
in repo root - it deletes all untracked files beingnode_modules
,Pods
, etc.. When done with that, the Pods should now be installed by runningbundle install && bundle exec pod install
. Let me know if anything changes for you!
I updated Reanimated but it didn't help. Components that use Reanimated don't work even in storybook.