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

[WebXR] Fix closure compiler mangling XRSession.enabledFeatures #93593

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

dsnopek
Copy link
Contributor

@dsnopek dsnopek commented Jun 25, 2024

Currently, when running a WebXR app with a release build using the Closure compiler, it'll crash on entering an XR session with this error (from Chrome with the WebXR API Emulator):

index.js:7340 Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
    at Function.from (<anonymous>)
    at index.js:7340:42

This was introduced by PR #88411, which added a reference to XRSession.enabledFeatures (among other things), but I forgot to add it to the webxr.extern.js file for the Closure compiler, in order to prevent it from doing its usual name mangling thing.

@dsnopek dsnopek added this to the 4.3 milestone Jun 25, 2024
@dsnopek dsnopek requested a review from a team June 25, 2024 14:01
@dsnopek dsnopek requested a review from a team as a code owner June 25, 2024 14:01
@dsnopek dsnopek force-pushed the webxr-closure-compiler-fix branch from 13a81a0 to f4b6cb0 Compare June 25, 2024 16:19
@dsnopek
Copy link
Contributor Author

dsnopek commented Jun 25, 2024

Ack, I found another issue related to enabledFeatures: it's not supported on Firefox. It isn't related to the Closure compiler piece, but I could perhaps sneak it into this PR?

@dsnopek
Copy link
Contributor Author

dsnopek commented Jun 25, 2024

Nevermind, Firefox needs more fixes than just checking that enabledFeatures is available - I'll work on that in another PR.

@dsnopek dsnopek force-pushed the webxr-closure-compiler-fix branch from f4b6cb0 to f3b5cfe Compare June 25, 2024 16:49
@dsnopek
Copy link
Contributor Author

dsnopek commented Jun 25, 2024

Nevermind my nevermind :-)

The issues I'm having with WebXR on Firefox appear to be specific to Linux with the proprietary nvidia drivers! See https://bugzilla.mozilla.org/show_bug.cgi?id=1896611

So, I've snuck in the check to make sure that enabledFeatures is available before trying to access it, which should fix Firefox.

@dsnopek dsnopek force-pushed the webxr-closure-compiler-fix branch from f3b5cfe to 9b42333 Compare June 25, 2024 17:38
Copy link
Contributor

@Malcolmnixon Malcolmnixon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, and I can confirm it WebXR is functional in both desktop browsers (with a WebXR plugin) and the Quest VR headset browser.

@akien-mga akien-mga merged commit 2043a01 into godotengine:master Jun 26, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@dsnopek dsnopek deleted the webxr-closure-compiler-fix branch July 22, 2024 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants