Search Issue Tracker
By Design
Votes
0
Found in
2017.2.0f3
Issue ID
968373
Regression
No
[WebGL] "Uncaught SyntaxError: missing ) after argument list" appear in browser after build
How to reproduce:
1. Download attached project file and open "Init" Scene
2. Switch Platform to WebGL
3. Press Build & Run
Expected result: Game should work without any javascript errors
Actual result: Built game didn't work, "SyntaxError: missing ) after argument list", "SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data" error appears in the console.
Reproduced with: 5.6.4p2, 2017.1.2p2, 2017.2.0p2, 2017.3.0b9, 2018.1.0a4
Tested on: Chrome, Firefox, Edge
Comments (2)
-
sacb0y
Nov 15, 2018 05:29
This needs explanation
-
durp
Feb 05, 2018 03:39
This is marked as resolved. Where is the missing )? Could I just insert it into my UnityLoader.js or do I need to get a new version of unity and rebuild?
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
The canvas object can be accessed in the following ways:
from html: gameInstance.Module.canvas
from js plugin: Module.canvas
however, you can only access the canvas object only once the game instance has been initialized. That can be done on onRuntimeInitialized event, for example:
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/<buildname>.json", { Module: {
onRuntimeInitialized: function() {
var c = this.canvas;
// do something with c
}