[object Event] Debug Error considering Events

I get this message occasionally via the debug log (more often on Touch devices than others)

I’ve been going about closing events like so:

   this.app.on('sampleEvent', this.sampleFunc, this);
    
    // Unsubscribe from events on destroy
    this.on('destroy', function() {
        app.off('sampleEvent', this.sampleFunc, this);
    });

Considering the above example, will the event only close when ‘destroy’ event is fired? I guess the deeper problem is when I leave the browser tab open then idle for awhile (1-2min etc), I’ll later return to the game with the message being displayed.

Or will the event only be turned off if the entity is deleted/disabled?

I need a deeper understanding to prevent this issue under the hood, I’m learning how to build with PlayCanvas by day yet sometimes by asking here helps for clarification.

What’s the full error in the devtools console?

If that is only when it happens, it’s most likely due to the network connection dropping that has a live link between the Editor and the Launch tab.

1 Like

This may be the culprit, I don’t remember seeing such messages when I exported a previous build. I also only utilize the live links issued by the Launch tab/button when testing/developing.

That’s the most the message would say considering Chrome iOS, most likely I will need to go to chrome://inspect on Chrome iOS to see further logs huh?

Maybe Safari? I’m not sure with Chrome on iOS :sweat_smile:

1 Like

I’m pretty sure it’s nothing with the code itself, honestly I believe its the first point you made since I only get it on the launch links and when I return to them after awhile.

I’ll test this upon exporting when the time comes. Thanks @yaustar

This error really annoys me. Happens when the browser is inactive for a short period of time. (Gives a new error every time the browser is idle). I see it in all projects. It looks like the project is still working fine, but I’m not quite sure yet. Haven’t seen it happen in a build. Can we do something about this error?

Theres a messaging network that is used so that the editor can update objects in the launch tab for live tweaking. When the tab is inactive, it errors out due to timeout I think. Its also why you dont see it in published builds