react-native icon indicating copy to clipboard operation
react-native copied to clipboard

TypeError: Cannot read property 'indexOf' of undefined, js engine: hermes

Open suneelkumargavara opened this issue 3 years ago • 0 comments

Description

I am working on a react-native project. I have been running the application on Android and iOS devices for the past 6 months. I haven't faced any problems till now. But suddenly today, while I am trying to run the application I am getting a compile error with the description. TypeError: Cannot read property 'indexOf' of undefined, js engine: hermes. I tried to debug the issue and found that there is an issue while connecting to the remote debugger. But the strange thing here is even I haven't selected the remote debugging option from either of emulator or simulator.

So, I have enabled the remote debugging option from the emulator to get a quick fix. It is working fine. But why is it connected to the remote debugger even after the fresh installation? And the quick fix comes with its own issues. The application is functioning a bit lag and inconsistent. I suspect there is an issue with the metro bundler. I have removed the cache using rm -rf /tmp/metro-* command, cleaned gradle using ./gradlew clean command, and cleaned iOS build by deleting derived Data. But still, the issue persists.

Is there any other step am I missing here? If it is the issue with the metro bundler, is there any way to reset it completely?

Version

0.67.5

Output of npx react-native info

System: OS: macOS 12.6.2 CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz Memory: 145.70 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 14.20.1 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 6.14.17 - /usr/local/bin/npm Watchman: 2022.07.04.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.2 AI-212.5712.43.2112.8609683 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: javac 11 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: ^0.67.1 => 0.67.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

Even after the fresh installation(i.e., running on an emulator even for the first time), I am getting this issue.

Snack, code example, screenshot, or link to a repository

Screenshot 2023-01-13 at 5 53 53 PM

suneelkumargavara avatar Jan 13 '23 12:01 suneelkumargavara