Search Issue Tracker
Fixed in 2022.1.X
Fixed in 2021.2.X
WebGL build fails to execute 'querySelector' if the canvas id starts with a '#' in Unity Play
How to reproduce:
1. Open the attached project from "UnityPlayProto21.zip"
2. Navigate to "Publish" -> "WebGL Project" -> "Build and Publish"
3. When the build succeeds in publishing it'll open in an internet browser, then open the browser's Console and start the game
Expected result: WebGL build succeeds in ignoring '#' in the canvas ID
Actual result: WebGL build doesn't run due to a '#' in the canvas ID
Reproducible with: 2021.2.1f1, 2022.1.0a13
Not reproducible with: 2019.4.32f1, 2020.3.22f1, 2021.1.28f1
1. It appears that the new WebGL loader doesn't check for '#'
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- ‘[…] doesn't have a texture property '_MainTex’’ error when using Gizmos with [MainTexture] attribute
- "undefined symbol: WebView_loadHtml (referenced by top-level compiled C/C++ code)" errors when building a WebGL build
- Script recompiles in Play Mode when Script Changes While Playing option is set to Recompile After Finished Playing and Auto refresh is set to enabled.
- [Windows][Vulkan] Scrambled texture objects are rendered when setting one with Texture2D.UpdateExternalTexture
- NullReferenceException errors appear when using "select half" button