App.loader is undefined?

we made our own loading scene by this:

pc.script.createLoadingScreen(function (app) {
app.loader.getHandler(‘texture’).crossOrigin = ‘anonymous’;

but there is weird problem that, on some devices, it will cause exception:

TypeError: Cannot read property ‘getHandler’ of undefined
at__loading__.js:434:19
at playcanvas-stable.min.js:935:407)
at__loading__.js:433:15
at loading.js:531:3

we can not re-produce it on our end, only collect these exceptions remotely. kind of wired, how could app.loader is undefined?

Not sure what the error is. Things I would try to reproduce the error are:

  • Try on slower connections/reduce speeds manually
  • Different browsers and versions
  • Increase the latency times
  • Check for earlier exceptions?

thanks for the tip, it’s really wired, I tried the methods you suggested, using chrome dev tools to slow the connection to 20k/s and 1000ms latency, which is slow enough and still can not reproduce the problem.

our game run in facebook messenger(instant game), so the browser should be consistent.
still can not figure out why app.loader became “undefined”, which in any case seems impossible…