Catch screen.orientation.lock error
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 17.6k
- Forks
- 4.4k
- PR merge metrics
- No merged PRs in 30d
Description
Using Chrome on Samsung S10+ with Aframe latest I always get this error below when entering VR
Problem seems to change add a catch to the screen lock promise in line 325 of a-scene.js
if (self.isMobile && screen.orientation && screen.orientation.lock) {
screen.orientation.lock('landscape').catch(function screenLockError(e) {
console.log(e);
});
}
The subsequent error is coming from
if (self.isPresenting) {
if (screen.orientation && screen.orientation.lock) {
screen.orientation.lock('landscape-primary').catch(function (error) {
console.error('screen.orientation.lock() failed due to', error.message);
});
}
Which I think is part of the polyfill?
I have an S10+, with the Chrome VR Services app installed. Why is the polyfill still getting called?
I see in other cases of this problem it could be related to having Angular on the page. I have React on the page, which I can't really remove. I'm not sure why it would make a difference to this uncaught error which is now being caught.
Site in question is https://app.showhow.nz, just click on the VR button on a phone.
6.chunk.js:72759 Uncaught RangeError: Maximum call stack size exceeded.
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
VRDisplay.fireVRDisplayPresentChange_ @ 6.chunk.js:58663
onFullscreenChange @ 6.chunk.js:58585
Show 144 more frames
56.chunk.js:70891 Uncaught RangeError: Maximum call stack size exceeded.
at HTMLElement.<anonymous> (6.chunk.js:70891)
at enterVRSuccess (6.chunk.js:72761)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
at HTMLElement.value (6.chunk.js:72726)
at HTMLElement.value (6.chunk.js:72901)
at bound (6.chunk.js:77879)
at enterVRSuccess (6.chunk.js:72759)
emit @ 6.chunk.js:70891
enterVRSuccess @ 6.chunk.js:72761
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
enterVRSuccess @ 6.chunk.js:72759
enterVR @ 6.chunk.js:72726
onVRPresentChange @ 6.chunk.js:72901
bound @ 6.chunk.js:77879
VRDisplay.fireVRDisplayPresentChange_ @ 6.chunk.js:58663
onFullscreenChange @ 6.chunk.js:58585
Show 145 more frames
6.chunk.js:375347 screen.orientation.lock() failed due to A call to screen.orientation.lock() or screen.orientation.unlock() canceled this call.
console.<computed> @ 6.chunk.js:375347
(anonymous) @ 6.chunk.js:58567
Promise.catch (async)
onFullscreenChange @ 6.chunk.js:58566
6.chunk.js:375483 Uncaught Error: The error you provided does not contain a stack trace.
at B (6.chunk.js:375483)
at G (6.chunk.js:375800)
at 6.chunk.js:375815
at 6.chunk.js:375834
at 6.chunk.js:375315
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at line 325 of a-scene.js and trace the screen.orientation.lock calls, then compare them with the polyfill path shown in the stack trace. Reproduce the VR-button flow on Chrome on a Samsung S10+ with the Chrome VR Services app installed; done means the orientation-lock failure is handled without the recursive enterVRSuccess stack overflow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- ar-vr-xr, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100