[SOLVED] Error while publishing + dwl/upl of project scene

Hello, I am having major issues with a scene that turns black while:

  1. Playcanvas publishing (https://playcanv.as/b/fb644cNZ/) +
  2. dwl/upl of project scene (tmp link: https://amfibios.dk/Deson/WCE/)

What to do?

Looks like an error on the custom pre loader that you are using

I get a null exception error on hideSplash when trying to find the splash wrapper.

Edit: For some reason, hideSplash gets called twice :thinking:
Edit2: As a stupid question, did you include all the scenes into the build? Looks like it can’t load a specific scene?

Nevermind, found the error. Try launching the editor version without the the ?debug=true on the end, you get the same black screen issue.

Your CommScrScript.prototype.gfg_Run function is causing this issue as it doesn’t handle the case of no parameters.

You were right - works with a try/catch around it :slight_smile:
I will have to start and use the console in that way also when debugging

Or you could check for the number of params/possible edge case.

I understand your apporach - still, apparently there is a difference in how things compile in editor vs exported (will be more aware of this now)

There shouldn’t be. The code is only concatenated. What differences are you seeing? I’ve reproduced the error with the Editor.

The only difference I’ve found between editor vs build launching a Playcanvas app is when I do something special with asset.getFileUrl().

When launching from the editor a different/relative url will be returned.

Also if you are accessing anything in the pc.app.stats namespace, I think most of the properties won’t be available in a published build (not sure if this has changed now).

Just to make it clear, I can ‘fix’ your published build in the first post just by changing the URL https://playcanv.as/b/fb644cNZ/?foobar=foobar

Yes, I am all into the ‘breaking down uploaded/published’ if ‘params’ wasn’t fulfilled
The try/catch wasn’t necessary at editor debugging (thus a difference somehow >> editor could live without the ‘?foobar=foobar’ string)
// again thanks

The editor version broke for me when I removed all params. eg https://launch.playcanvas.com/889950

The real fix for me is to do the following:

CommScrScript.prototype.gfg_Run = function () {
    //  var current_url = location.href;    //// NB! husk der er fejl på sidste-felt exvis 'mange,15280' bliver ikke vist grundet indeksering!!!!!!!
    // var current_url = "https://amfibios.dk/N3E/RTP3/WeMesk/modtager.php?sk=undefined@mit,8204@jern,9546@hoved,11231@en,11231@helligdag,13413@mange,15280";

    var url = window.location.href;
    var params = url.split('?'); 

    if (params.length > 1) {

        var current_url_eftSpT = params[1]; console.log(current_url_eftSpT);
        // etc
1 Like