Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Page load blocked on JS error TypeError: vrDisplay is null (thrown intermittently); causes Gecko to crash! #99

Closed
caseyyee opened this issue Feb 2, 2018 · 12 comments
Assignees

Comments

@caseyyee
Copy link
Contributor

caseyyee commented Feb 2, 2018

when opening in Firefox using windows MR. Seems to happen when headset is idle on not on my head.

Not exactly sure where it is originating from. Polyfill maybe?

@cvan
Copy link
Contributor

cvan commented Feb 5, 2018

This smells like a Firefox platform bug. If so, I can file a Bugzilla Gecko bug. Perhaps this could be solved in the meantime with a hack of adding an event listener for vrdisplayconnect: window.addEventListener('vrdisplayconnect', function () { getVRDisplays(); });

somewhat related: looks like the vrdisplayconnect event still fires every time upon page load if there's a VR display connected

also, could you paste a screenshot and/or JS Console errors/warnings?

@cvan
Copy link
Contributor

cvan commented Feb 7, 2018

@caseyyee: do you think this belongs in the initial milestone?

@caseyyee
Copy link
Contributor Author

caseyyee commented Feb 7, 2018

unity-webvr-export - firefox nightly 2018-02-06 11_39_55 pm

@caseyyee
Copy link
Contributor Author

caseyyee commented Feb 7, 2018

Actually, I think this might be C# code in Unity. Some types of errors are raised as alert boxes for some reason. I'll dig in.

@cvan its intermittent. I'll see if I can resolve, but I don't think we need to block.

Either way, the experience loads after you press OK anyways.

@cvan
Copy link
Contributor

cvan commented Feb 7, 2018

@caseyyee:

if you log each event in onUnity, what's the order of the events? I assume "Ready" is always getting fired first, yes?

try adding this to index.html:

          onProgress: unityProgress,
          handler: errorhandler
        });

        var errorhandler = function (msg, url, lineNo, columnNo, error) {
            console.error('Message: %s; URL: %s; Line: %s, Column: %s; Error:\n',
              msg,
              url,
              lineNo,
              columnNo,
              error);
          return false;
        };

@cvan
Copy link
Contributor

cvan commented Feb 7, 2018

from @kearwood:

call GetVRDisplays on load if you detect Firefox 58 and see if a VRDisplay is returned. Waiting for vrdisplayconnect before using GetVRDisplays is best in all other cases and in FF59+; however.

@caseyyee: can you try that?

@cvan cvan added this to the Community release milestone Feb 8, 2018
@cvan
Copy link
Contributor

cvan commented Feb 8, 2018

having the headset on or off doesn't seem to affect this. I can't figure out reliable steps to reproduce this. @caseyyee: if you can, let me know.

@cvan
Copy link
Contributor

cvan commented Feb 8, 2018

additional follow up: I rebuilt the Unity project, and I encountered the issue immediately. and after I dismissed the alert prompt, Firefox Nightly crashed.

here's one of the crashes: https://crash-stats.mozilla.com/report/index/8b59877c-48ec-4d69-a5f4-9e2da0180208

image

looks like the crash happened at nsGlobalWindowInner::DispatchVRDisplayActivate(unsigned int, mozilla::dom::VRDisplayEventReason)

@kearwood: any ideas? (@caseyyee: looks like, regardless of the fix/workaround we discover, we ought to file a Gecko platform bug on Bugzilla for this.)

@delapuente
Copy link
Contributor

It is worth solving or researching this issue bat not blocking on it so, moving to the next release.

@cvan cvan self-assigned this Feb 9, 2018
@cvan cvan changed the title get VRDisplay null alert when loading Intermittent TypeError: vrDisplay is null error is thrown; Gecko crash Feb 14, 2018
@cvan cvan changed the title Intermittent TypeError: vrDisplay is null error is thrown; Gecko crash Page load blocked on JS error TypeError: vrDisplay is null (thrown intermittently); causes Gecko to crash! Feb 14, 2018
@delapuente
Copy link
Contributor

delapuente commented Feb 15, 2018

Can we retest this after merging #132 It is probable that PR can solve this too. But this is something we should address properly, talking to Unity folks to determine the exact order of the events.

@cvan
Copy link
Contributor

cvan commented Feb 15, 2018

also, I'll set a task item for me to file a Bugzilla bug. no matter how poorly I write my WebVR event listeners, I shouldn't be able to crash Gecko 💥!

@caseyyee
Copy link
Contributor Author

works for me. reopen if you encounter this issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants