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

fix for syntax regression in Meta Oculus Quest Browser #180

Open
wants to merge 3 commits into
base: mainline2.0
Choose a base branch
from

Conversation

trusktr
Copy link

@trusktr trusktr commented Aug 27, 2023

Note

This is branched off of the branch for

That pull request can be merged first to fix the build, but the build for this branch also works (no build!). For convenience, here's the diff between the branches as the Files changed tab will not be as convenient.

Description

For whatever reason, depending on the URL used to visit the app in Oculus Browser (f.e. a deployment using an HTTPS domain, vs running via localhost or an IP address), the return values of .keys() and .values() methods for Map, Set, and Array will cause a syntax error when spread into an array.

For example, when Oculus Browser gets into this broken state, this code

const array = [...( new Set( [1, 2, 3] ).keys() )]

will cause this error to be thrown:

Uncaught TypeError: Set.keys is not a function or its return value is not iterable

Sometimes the problem does not happen, depending on how an app is accessed, but I'm not sure exactly what causes it.

Converting code like [...set.keys()] to Array.from(set.keys()) works around the issue in Oculus Browser.

Related Issue #

N/A

Reviewer Testing Instructions

Try deploying the test example to some server, f.e. on nodechef.com, then hope that the issue happens in Oculus Browser in Oculus Quest Pro.

The following diff, in the project where I'm experimenting with this, shows the change to the host.three.js file that makes the app work (search for "this._states.values()" for example):

015692de31d62d3cd9fb9c125f24f331d21d7b27..31071e142a1432fedc73758b3dd07f0b8a07ec10

That host.three.js file is the one I copied out of this repo after running npm run build.

After I made the chages seen here in this PR, I ran npm run build, then I copied packages/amazon-sumerian-hosts-three/dist/host.three.js into that autonomys repo to fix the app.

Submission Checklist

I confirm that I have...

  • removed hard-coded Cognito IDs
  • manually smoke-tested the BabylonJS integration tests
  • manually smoke-tested the BabylonJS demos
  • manually smoke-tested the Three.js integration tests
  • manually smoke-tested the Three.js demo

I also manually tested core.lex.html using the start-core server, but that test is broken on mainline2.0 also with a 404 on a Lex URL. I suppose it has gone stale, and it doesn't really matter because both Babylon and Three tests/examples work.


This contribution is licensed under the original MIT-0 license of the repository. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trusktr trusktr changed the title fix for syntax regression in Oculus Browser fix for syntax regression in Meta Oculus Quest Browser Aug 27, 2023
* fix-broken-webpack-dependency:
  pin webpack dependency versions so they won't break, and we can update them manually when we need to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant