MozillaReality / unity-webxr-export

INACTIVE - Assets for creating WebXR-enabled Unity3D projects.
https://mixedreality.mozilla.org/unity-webxr-export/Build/
Apache License 2.0
624 stars 127 forks source link

fix `Source map error` JS error for missing external source-maps file in `webvr-polyfill` #54

Closed cvan closed 6 years ago

cvan commented 6 years ago

https://github.com/caseyyee/unity-webvr-export/blob/e119886/Assets/WebVR/Plugins/webvr-polyfill.min.jspre#L43

screen shot 2017-12-19 at 1 10 19 pm
cvan commented 6 years ago

currently, we were using an older version of the webvr-polyfill but in webvr-polyfill.min.js, there was a link to an external source map for webvr-polyfill.min.js.map which is missing in the assets here. (the JS dist files for the new version doesn't include source maps anymore, but it should; for reference: I've filed issue immersive-web/webvr-polyfill#302).

the latest version of webvr-polyfill now has a peer dependency of cardboard-vr-display, which handles all the polyfilling logic for emulation of WebVR v1.1 API for Cardboard and the like.

anyway, we should update webvr-polyfill and test it accordingly:

  1. replace the currently webvr-polyfill.min{.jspre,.jspre.meta} files with the latest version of the webvr-polyfill: https://raw.githubusercontent.com/immersive-web/webvr-polyfill/master/build/webvr-polyfill.min.js
  2. reload the asset files in Unity; build, run, and test the following VR setups:
    • Firefox on Windows with Vive, Windows MR, Rift
    • Chrome Canary on Windows with Vive, Windows MR, Rift
    • release-channel Microsoft Edge on Windows with at least Windows MR (Vive + Rift would be nice to test, but not required)
    • release-channel Firefox/Chrome/Edge on Windows
    • release-channel Firefox/Chrome/Safari on macOS
    • Samsung Gear VR
    • Google Daydream (with flags enabled: chrome://flags#enable-webvr and chrome://flags#enable-gamepad-extensions)
    • Google Cardboard for Android (with flags enabled: chrome://flags#enable-webvr and chrome://flags#enable-gamepad-extensions)
      • test with Generic Sensor API enabled (with additional flag enable: chrome://flags#enable-generic-sensor)
    • iPhone 6+ (running iOS 10)
    • iPhone 7+ (running iOS 11)

the reason for the exhaustive testing is to ensure that there have been no regressions since the latest version of webvr-polyfill that could trigger the emulation/polyfill code path (or anything that degrades rendering performance) on the various platforms + browsers.

delapuente commented 6 years ago

I'm getting this error when trying to enter VR in the Android versions of Firefox and Chrome, and for both polyfill versions: the outdated and updated one. I got to reproduce it using device emulation from the Chrome devtools.

recursion-error

cvan commented 6 years ago

I’ve seen this error before. I swore I file it before, but I can’t find it.

can you set some breakpoints and step through it?

@caseyyee: if I recall correctly, you fixed this issue before by updating the game’s allocated memory size in Unity’s options. do you recall?

cvan commented 6 years ago

I filed https://github.com/mozilla/unity-webvr-export/issues/113 to handle a thoroughly tested upgrade of webvr-polyfill. This issue will be for just fixing the missing external source-map.

caseyyee commented 6 years ago

If it runs out of memory, you get a different error altogether. Seems like a different issue.

I just tried on my Pixel XL, and the experience works and runs for me and don't seem to be seeing the raf errors.

Though, in the console, I get issue https://github.com/mozilla/unity-webvr-export/issues/64

delapuente commented 6 years ago

Closing in favour of #115