[SOLVED] Application CRASHING on Safari 15 - MacOS!

As per the announcement here,

We updated our playcanvas engine to 1.46.5 however, the published application (which is live at, https://jnj-unmatch.vtour.tech/workshop), is still crashing on safari 15. I guess it was meant to run fine after updating engine and re-publishing the scene, but no luck.

image

This is the error we get. Are we missing something? Please help.

Looking at the site, it is still on version 1.46.1

This is the link that i’ve mentioned in the issue.

https://jnj-unmatch.vtour.tech/workshop

Can you try?

Ah that redirected me to main hub, we are able to reproduce now. Investigating

Appreciated, it’s a live store with an active traffic, so we have bought some downtime haha.

@Ankit Would you be able to send us a link to a build that we can run locally and make changes or be able to add ‘yaustar’ to the PlayCanvas project so we can fork it and take a look please?

(Access to the project is preferable if possible)

https://s3.eu-west-1.amazonaws.com/archives.playcanvas.com/542e8e34d91cdc0ed6e8ffbdec80e2b0/Jack%20n%20Jones%20Unmatched%20-%20Workshop.zip

This is a build of one of three scenes of the store.

I’m also adding you in my team with read access, lemme know once you fork it.

Project URL : https://playcanvas.com/project/813807

(There are three scenes, So you can build anyone of them and test it thru self-hosted.)

Thanks, forked and downloaded

@yaustar Awesome! expecting a hotfix soon :slight_smile:

Found the issue: It’s due to the WebXR polyfill in the project being called on startup which is the bug with Safari 15 that we had to workaround in the engine.

In the scripts folder, delete the webxr-polyfill* files as they are duplicates:

Open webvr-polyfill folder and open the script webxr-polyfill-patch.js file

Change the contents to:

(function(){
    if (pc.platform.browser && !!navigator.xr) {
        var polyfill = new WebXRPolyfill();
    }
})();

Test on Safari 15

@yaustar I’m trying this fix, will update once done.

Sorry, I made a mistake here. The code should be:

(function(){
    if (window.navigator && !!navigator.xr) {
        var polyfill = new WebXRPolyfill();
    }
})();

@yaustar It worked perfectly, just uploaded and published it live, here’s the URL :

Although I have published with “pc.platform…” and not “window.platform” as I didn’t see your updated comment before making changes. We tested on all of the devices and it’s up and running as intended. I’ll update with the necessary changes later.

Thanks for your help, and for providing the solution promptly. We appreciate it. :innocent:

1 Like

@Ankit Side note that you with my first (bad) code fix, you will get errors in the console about pc not defined just in case you have crash log tracking on the site.