ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot read property 'VIRO_VERSION' of undefined

laurensius opened this issue · comments

Environment

  1. Development OS: MacOS Sonoma
  2. Device OS & Version: Android 11
  3. Version: ViroReact @viro-community/react-viro : ^2.40.0 and React Native 0.73
  4. Device(s): Realme 7i

Description

I encountered the error "cannot read property 'VIRO_VERSION' of undefined when trying to run the application on an Android device.

Reproducible Demo

Screenshot 2024-02-19 at 13 42 21

System:
OS: macOS 14.3.1
CPU: (12) arm64 Apple M2 Pro
Memory: 241.84 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 21.1.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.2.0 - /opt/homebrew/bin/npm
Watchman: 2023.10.30.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.14.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, visionOS 1.0, watchOS 10.2
Android SDK:
System Images: android-28 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs

  facing same issue 

Hello @robertjcolley, I still encounter errors :
Screenshot 2024-02-20 at 11 46 03

@robertjcolley I'm still getting same problem too.

thanks for update this error.

@badararain @illlama Hi, are you still facing the same error? Has anyone found a solution? It seems that this problem originates from ViroARSceneNavigator.
WhatsApp Image 2024-02-19 at 13 49 10 (1)
WhatsApp Image 2024-02-19 at 13 49 10

Getting the same error. Just downloaded the starter-kit today, but still having the issue. If I dismiss my way through it in debug mode I get to the AR, but it just dies in release mode. This happens on both android and ios. I checked in node_modules/@viro-community/react-viro/index.ts and there are the import/export statements. The value for VIRO_VERSION in components/Utilities/ViroVersion.ts is "2.40.1".

@robertjcolley - looking into this a bit further, the problem seems to be in Telemetry/index.ts which independently attempts to read VIRO_VERSION, which is why the fix doesn't work. Looking at the code, I don't understand why the import in Telemetry doesn't work, but it seems it doesn't.

I cannot reproduce on my viro test bed application. I'll try on the starter kit and see what happens. Hang tight, everyone!

To get this to work (kludge, not solution) I actually needed to comment out 2 lines in Telemetry/index.js in dist. One was the assignment of VIRO_VERSION. I replaced it with the text "2.40.1". Then I still got an error on the line that tests if expo is present. I commented that out and now the starter-kit runs both on ios and android without glitches. The expo test is really strange, as there is a try/catch block around the call, but it still throws an error. Note that both problems are related to require.

I know that's not a solution, but hopefully it can shed some more light on the problem.

I cannot reproduce on my viro test bed application. I'll try on the starter kit and see what happens. Hang tight, everyone!

Thank you for the response. Hopefully there is a solution to this error.

@badararain @illlama Hi, are you still facing the same error? Has anyone found a solution? It seems that this problem originates from ViroARSceneNavigator. WhatsApp Image 2024-02-19 at 13 49 10 (1) WhatsApp Image 2024-02-19 at 13 49 10

Yes we are getting the same error we have downgrade to one down to resolved this issue

#261 fixes this issue. I'll leave this open until I do a release (later today). Thanks everyone for your patience!