HTML5 issues - exception thrown: TypeError: Cannot read property 'apply' of undefined,

I’m not sure why this is happening but I’ll document possible solution in this thread. At the moment, it seems entirely random when it happens… could be related to CDN issues possibly?

exception thrown: TypeError: Cannot read property ‘apply’ of undefined,

dmloader.js:512 exception thrown: TypeError: Cannot read property 'apply' of undefined,TypeError: Cannot read property 'apply' of undefined
    at _emscripten_asm_const_int (<anonymous>:1:123478)
    at <anonymous>:wasm-function[4538]:0x15c5dd
    at <anonymous>:wasm-function[4831]:0x179a6a
    at <anonymous>:wasm-function[3184]:0xf43dc
    at <anonymous>:wasm-function[1131]:0x38ca8
    at <anonymous>:wasm-function[4420]:0x15694e
    at <anonymous>:wasm-function[4409]:0x154c15
    at <anonymous>:wasm-function[4412]:0x15580c
    at <anonymous>:wasm-function[2947]:0xe5aba
    at Mh (<anonymous>:wasm-function[2726]:0xd37ad)
printErr @ dmloader.js:512
callMain @ VM20:1
_preloadAndCallMain @ dmloader.js:828
onArchiveLoaded @ dmloader.js:720
notifyListeners @ dmloader.js:213
notifyArchiveLoaded @ dmloader.js:235
onArchiveLoaded @ dmloader.js:406
onFileLoaded @ dmloader.js:398
onPieceLoaded @ dmloader.js:346
(anonymous) @ dmloader.js:318
request.onload @ dmloader.js:91
xhr.onload @ dmloader.js:36
load (async)
send @ dmloader.js:35
load @ dmloader.js:98
downloadPiece @ dmloader.js:302
downloadContent @ dmloader.js:281
onFileLoaded @ dmloader.js:400
onPieceLoaded @ dmloader.js:346
(anonymous) @ dmloader.js:318
request.onload @ dmloader.js:91
xhr.onload @ dmloader.js:36
load (async)
send @ dmloader.js:35
load @ dmloader.js:98
downloadPiece @ dmloader.js:302
downloadContent @ dmloader.js:281
onFileLoaded @ dmloader.js:400
onPieceLoaded @ dmloader.js:346
(anonymous) @ dmloader.js:318
request.onload @ dmloader.js:91
xhr.onload @ dmloader.js:36
dmloader.js:511 INFO:CRASH: Successfully wrote Crashdump to file: /data/.Defold/_crash
dmloader.js:512 ERROR:CRASH: CALL STACK:
printErr @ dmloader.js:512
put_char @ VM20:1
write @ VM20:1
write @ VM20:1
doWritev @ VM20:1
_fd_write @ VM20:1
(anonymous) @ 0070a67e:0x17398f
(anonymous) @ 0070a67e:0x5fc91
(anonymous) @ 0070a67e:0xe67b
(anonymous) @ 0070a67e:0x3abe
(anonymous) @ 0070a67e:0x15a0db
Vh @ 0070a67e:0x179809
Module._JSWriteDump @ VM20:1
ccall @ VM20:1
window.onerror @ dmloader.js:860
2dmloader.js:512 
printErr @ dmloader.js:512
put_char @ VM20:1
write @ VM20:1
write @ VM20:1
doWritev @ VM20:1
_fd_write @ VM20:1
(anonymous) @ 0070a67e:0x17398f
(anonymous) @ 0070a67e:0x5fc91
(anonymous) @ 0070a67e:0xe67b
(anonymous) @ 0070a67e:0x3abe
(anonymous) @ 0070a67e:0x15a0db
Vh @ 0070a67e:0x179809
Module._JSWriteDump @ VM20:1
ccall @ VM20:1
window.onerror @ dmloader.js:860
dmloader.js:512 ERROR:CRASH: ["TypeError: Cannot read property 'apply' of undefined","_emscripten_asm_const_int@<anonymous>:1:123478","@<anonymous>:wasm-function[4538]:0x15c5dd","@<anonymous>:wasm-function[4831]:0x179a6a","@<anonymous>:wasm-function[3184]:0xf43dc","@<anonymous>:wasm-function[1131]:0x38ca8","@<anonymous>:wasm-function[4420]:0x15694e","@<anonymous>:wasm-function[4409]:0x154c15","@<anonymous>:wasm-function[4412]:0x15580c","@<anonymous>:wasm-function[2947]:0xe5aba","Mh@<anonymous>:wasm-function[2726]:0xd37ad"]