ReactVision / viro

ViroReact: The AR and VR library for React Native 📳💙💛🤍💚
MIT License
1.3k stars 150 forks source link

cannot read property 'VIRO_VERSION' of undefined #267

Closed laurensius closed 4 months ago

laurensius commented 4 months ago

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

linear[bot] commented 4 months ago

XR-175 cannot read property 'VIRO_VERSION' of undefined

badararain commented 4 months ago

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 
laurensius commented 4 months ago

Hello @robertjcolley, I still encounter errors :

Screenshot 2024-02-20 at 11 46 03
illlama commented 4 months ago

@robertjcolley I'm still getting same problem too.

thanks for update this error.

laurensius commented 4 months ago

@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

mattdfuchs commented 4 months ago

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".

mattdfuchs commented 4 months ago

@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.

robertjcolley commented 4 months ago

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

mattdfuchs commented 4 months ago

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.

laurensius commented 4 months ago

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 commented 4 months ago

@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

mattdfuchs commented 4 months ago

What exactly do you mean by “we have downgrade to one down”? Also, the problem is in Telemetry not ViroARSceneNavigator.

On Wed, Feb 21, 2024 at 11:33 PM Badar Arain @.***> wrote:

@badararain https://github.com/badararain @illlama https://github.com/illlama Hi, are you still facing the same error? Has anyone found a solution? It seems that this problem originates from ViroARSceneNavigator. [image: WhatsApp Image 2024-02-19 at 13 49 10 (1)] https://private-user-images.githubusercontent.com/283553/306477799-b079499c-5cdd-448f-984a-8352b89f2867.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDg1ODczMjksIm5iZiI6MTcwODU4NzAyOSwicGF0aCI6Ii8yODM1NTMvMzA2NDc3Nzk5LWIwNzk0OTljLTVjZGQtNDQ4Zi05ODRhLTgzNTJiODlmMjg2Ny5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDIyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAyMjJUMDczMDI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YzU4OTJmMDEzNDYyNTI4NzZlNTkzZjI4M2Q4NmQwMmE3MDYwODRiZDhiNjcwNzgyZmRmZDFjMTc1YThkNjQ5NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.9kPNe_dUdwtn-M-E6LeUAHuXYucyJdoZH6RJYh7T3KI [image: WhatsApp Image 2024-02-19 at 13 49 10] https://private-user-images.githubusercontent.com/283553/306477812-79420357-78ad-42a7-882e-ff52a16e328f.jpeg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDg1ODczMjksIm5iZiI6MTcwODU4NzAyOSwicGF0aCI6Ii8yODM1NTMvMzA2NDc3ODEyLTc5NDIwMzU3LTc4YWQtNDJhNy04ODJlLWZmNTJhMTZlMzI4Zi5qcGVnP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDIyMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAyMjJUMDczMDI5WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2UzMjk1NmNmMjJlY2MzMTZkOTc1ZjAyNmVhZjFhNGZhYWFiZDU0ZGVkODQ0YTAwYjk2M2RlOGQ4Nzg0ZmU5MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Mgj70BuzgJJmD_lo62hW5N0-xVdq6d4UG97dUX-sL-8

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

— Reply to this email directly, view it on GitHub https://github.com/NativeVision/viro/issues/267#issuecomment-1958859788, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUC3S6UPWYPSAAPQQH3TD3YU3YEDAVCNFSM6AAAAABDO42P72VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYHA2TSNZYHA . You are receiving this because you commented.Message ID: @.***>

robertjcolley commented 4 months ago

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