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
- Error “NullReferenceException: Object reference not set to an instance of an object“ is present when the UI Toolkit Debugger window is docked and inactive on Editor launch
- RenderTexture pixels are gray when created without drawing on macOS
- Slider disappears when the Baked Lightmap Viewer window is at its minimum size
- Crash on 'TransformParticleMesh' when setting Particles in PlayMode
- UI Toolkit Window popups are cropped when using an UHD monitor coupled with a lower resolution monitor
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
}