Hi,
I’ve devloped an Ionic app which embed unity WEBGL build game. (2020+ version)
The unity loader.js script is embedded on Ionic app and the “game” is istanced from web.
const unityConfig: UnityConfig = {
codeUrl: this.exercise.URLWebGL + ‘/web.wasm.gz’,
dataUrl: this.exercise.URLWebGL + ‘/web.data.gz’,
frameworkUrl: this.exercise.URLWebGL + ‘/web.framework.js.gz’,
streamingAssetsUrl: ‘StreamingAssets’,
companyName: ‘’,
productName: ‘’,
productVersion: ‘’
};
await this.ngZone.runOutsideAngular(async () => {
this.unityInstance = await createUnityInstance(
document.querySelector(‘#unity-canvas’),
unityConfig,
(progress) => this.handleUnityProgress(progress)
);
});
The instance start correctly and work very well.
The problem is when I have to Quit the game.
When I call this.unityInstance.Quit() I get the following error on inspector:
exception thrown: TypeError: Cannot read properties of null (reading ‘onwheel’),TypeError: Cannot read properties of null (reading ‘onwheel’)
at _emscripten_set_wheel_callback_on_thread (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.framework.js.gz:3:222957)
at MainLoop() (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.wasm.gz:wasm-function[26635]:0x889a5f)
at dynCall_v (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.wasm.gz:wasm-function[37130]:0xb9c8d8)
at browserIterationFunc (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.framework.js.gz:3:217614)
at callUserCallback (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.framework.js.gz:3:170812)
at Object.runIter (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.framework.js.gz:3:172072)
at Browser_mainLoop_runner (https://dev.medico-amico.com/packets/ORTHOPEDIC/Build/web.framework.js.gz:3:170347)
at l.invokeTask (https://dev.medico-amico.com/polyfills-es2015.98a5e5b154a74c7172ec.js:1:7313)
at i.runTask (https://dev.medico-amico.com/polyfills-es2015.98a5e5b154a74c7172ec.js:1:2722)
at invokeTask (https://dev.medico-amico.com/polyfills-es2015.98a5e5b154a74c7172ec.js:1:8363)
at invoke (https://dev.medico-amico.com/polyfills-es2015.98a5e5b154a74c7172ec.js:1:8265)
at n.args. (https://dev.medico-amico.com/polyfills-es2015.98a5e5b154a74c7172ec.js:1:32237)
Uncaught TypeError: Cannot read properties of null (reading ‘onwheel’)
at _emscripten_set_wheel_callback_on_thread (web.framework.js.gz:3:222957)
at MainLoop() (web.wasm.gz:0x889a5f)
at dynCall_v (web.wasm.gz:0xb9c8d8)
at browserIterationFunc (web.framework.js.gz:3:217614)
at callUserCallback (web.framework.js.gz:3:170812)
at Object.runIter (web.framework.js.gz:3:172072)
at Browser_mainLoop_runner (web.framework.js.gz:3:170347)
at l.invokeTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:7313)
at i.runTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:2722)
at invokeTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:8363)
at invoke (polyfills-es2015.98a5e5b154a74c7172ec.js:1:8265)
at n.args. (polyfills-es2015.98a5e5b154a74c7172ec.js:1:32237)
and than generate continuosly the following error
Uncaught RuntimeError: memory access out of bounds
at DynamicVBOBufferManager::CleanupClass() (web.wasm.gz:0x93c8e6)
at CallbackArray::Invoke() (web.wasm.gz:0x73d86)
at MainLoop() (web.wasm.gz:0x887f37)
at MainLoopUpdateFromBackground(void*) (web.wasm.gz:0xf68985)
at dynCall_vi (web.wasm.gz:0xb9c774)
at web.framework.js.gz:3:215820
at web.framework.js.gz:3:215841
at l.invokeTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:7313)
at i.runTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:2722)
at invokeTask (polyfills-es2015.98a5e5b154a74c7172ec.js:1:8363)
at invoke (polyfills-es2015.98a5e5b154a74c7172ec.js:1:8265)
at n.args. (polyfills-es2015.98a5e5b154a74c7172ec.js:1:32237)
do you have any idea?