Unity 2021.2 build throws error when removing the canvas before invoking Quit on the Unity Instance
See original GitHub issuePlease avoid duplicates
- I checked all open issues and discussions and none of them matched my problem.
Language and Compiler
Other TypeScript compiler
What environment are you using?
Local Development Server
When does your problem occur?
When the Unity Component unmounts
What does your problem relate to?
The problem seems Unity related
React-Unity-WebGL Version
latest
React Version
latest
Unity Version
2021.2
What happened?
Problem occurs within and outside of this module. An error is thrown when the canvas element is removed before invoking the Quit method on the Unity Instance.
TypeError: null is not an object (evaluating 'target.onwheel')
_emscripten_set_wheel_callback_on_thread@http://127.0.0.1:8080/Build/unity.framework.js
Reproducible test case
- Create a Unity WebGL build
- Add a button to the index.html which removed the Canvas element and than Quit’s Unity
- Run the application on a web server and click the button
- See error
Would you be interested in contributing a fix?
- yes, I would like to contribute a fix
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (5 by maintainers)
Top Results From Across the Web
IONIC WEBGL Out of memory on quit - Unity Forum
will throw a JS error. Before 2021.2, Unity would gracefully quit when canvas was destroyed - not anymore.
Read more >Troubleshooting - Unity - Manual
Issues when building packages, - Missing MonoBehaviour errors ... You can either reset your project's package configuration or remove the following line ...
Read more >Error when destroying unity webgl instance on Vue3
I have a working Unity WebGL application integrated with Vue3. ... Quit() during onUnmount event in Vue3, and the error changes to: enter ......
Read more >Manual: WebGL templates - Unity
, you need prior knowledge of JavaScript concepts and terminology. When you build a WebGL project, Unity embeds the Player in a HTML...
Read more >SDK & Release Notes - Photon Engine
*\Photon\Fusion\Resources\PhotonAppSettings.asset . Back To Top. Requirements. Unity 2020.3 or above;; Asset Serialization HAS to be set to text ( ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a double problem…
assuming you have a unityContext var and a state var “isLoaded”… the following is a fix.
hey @jeffreylanters looks like the Unity ticket is Closed.
@SashaVigneron1 I’m wrestling with this as well. I can explicitly call unityContext.quitUnityInstance() with a button on my page but when trying to handle the browser navigation I’m not able to work around it. .