PlayCanvas crashing when starting game

@LeXXik @Leonidas @Mads_Nielsen @Devortel

I’m still working on repro steps for the Chrome team about this issue. In the meantime, I think I’ve got a way to force the WASM (Ammo and Basis) to always load in the launch tab that I would like you folks to try in the meantime:

(function() {
    if (window.location.href.startsWith('https://launch.playcanvas.com')) {
        var wasm = window.config.wasmModules;
        var timestamp = Date.now();
        // Add a timestamp to the end of URLs
        for (var i = 0; i < wasm.length; ++i) {
            var m = wasm[i];
            if (m.wasmUrl.length > 0) {
                m.wasmUrl += '&bust=' + timestamp;
            } 
            
            if (m.glueUrl.length > 0) {
                m.glueUrl += '&bust=' + timestamp;
            } 
            
            if (m.fallbackUrl.length > 0) {
                m.fallbackUrl += '&bust=' + timestamp;
            } 
        }
    }
})();

Add this as a new script in the Editor and change the loading type to be ‘Before Engine’.

Example project: https://playcanvas.com/editor/scene/1245798

Let me know how you get on with this please :slight_smile:

More data is always good!

4 Likes

That’s a nice and clever trick! Adding it to my project and I will start testing asap.

1 Like

Nice :+1: I will try it as well!

1 Like

Preliminary test of this fix and everything looks good. No crashing as of now.

1 Like

Out of interest, when you saw this issue before, was it after waking the PC from sleep or after a really long Chrome session (several days)?

I started off with a project of mine that was failing yesterday. At first it was working fine. I kept monitoring the JS heap, but it was at the normal level all the time. After working on the project for like 10 minutes, changing non-Ammo related variables and refreshing the launcher, after one of the refreshes the app froze.

At that state, the JS heap was at normal level. Closing the browser completely and opening again did not solve the problem - the app was still freezing. After that I added your cache busting script and the app began to start normally. Closing the browser and opening again would not affect the app start - it would work norrmally. After disabling your script the app got back to freezing on start.

2 Likes

That’s great, thanks LeXXik

1 Like

Same here, after a couple of hours of working on an affected project no crash or freezing reported.

1 Like

I experienced the freezing issue within about 20 mins of a cold boot. Upon first loading my project, it worked fine, no freezes, but just like LeXXik reported, it was only after working on some non-Ammo, non-WASM scripts, I was able to recreate the freeze issue fairly reliably.

Since I added your script, I haven’t had a single freeze! :tada: But unlike LeXXik, after disabling your script, I can’t get my project to freeze again. I assume that’s just the randomness of caches. I’ll likely keep your script enabled for the forseeable future, unless there is something specific you’d like us to test for.

I really appreciate the support, @yaustar!

3 Likes

I had the problem again, and I can confirm this fixing it and allowing me to load the game again.

2 Likes

@Leonidas @Mads_Nielsen @LeXXik @Devortel @Bfischlin

Thanks again for all the information about this. The Chrome team has released a fix in version 94.0.4606.81

Please can you update to this version, remove my hacky patch and let us know if you don’t/do run into this issue again during this week :slight_smile:

4 Likes

Works for me :slight_smile: Thank you for the info!

1 Like

I’m back to square one after this fix, not even the hacky patch works anymore.

So I’m back to being locked out of some of my branches :frowning:

Can you try clearing out your cache and cookies for PlayCanvas.com?

Also, please try an incognito tab/window too

Removing the patch and updating to Chrome latest version seems to have fixed this for me (have been testing for about an hour).

2 Likes

As before Clearing cache for the entire browser works, but not sure if its just temporary. Will let you know if it comes back.

1 Like