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

TypeError: window.matchMedia is not a function #5921

Open
zajecvolk opened this issue Apr 20, 2024 · 3 comments
Open

TypeError: window.matchMedia is not a function #5921

zajecvolk opened this issue Apr 20, 2024 · 3 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS

Comments

@zajecvolk
Copy link

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

  1. Run npx expo run:ios
  2. 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

@github-actions github-actions bot added the Missing repro This issue need minimum repro scenario label Apr 20, 2024
Copy link

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?

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS labels Apr 20, 2024
@szydlovsky
Copy link
Contributor

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!

@zajecvolk
Copy link
Author

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!

I updated Reanimated but it didn't help. Components that use Reanimated don't work even in storybook.

Zrzut ekranu 2024-05-9 o 15 44 56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

2 participants