I can't run my WebGL build

Hello there,

When the game loads up in the browser (I’m using Safari), this error pops up:

How do I solve this error?

Hi,

Test your game in a different browser, e.g. Chrome and Firefox, to see if it is a problem with Safari.

I get the same error on Chrome and Firefox, presented differently:

Chrome:



Firefox:


Please follow Rob’s instruction.

My apologies for not formatting.

Here are the formatted versions of the errors:

Safari:

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
abort(195) at jsStackTrace (PvZ Themed Tower Defence.wasm.framework.unityweb:8:22322)
stackTrace (PvZ Themed Tower Defence.wasm.framework.unityweb:8:22496)
onAbort@https://s3-us-west-2.amazonaws.com/sharemygame.com/dc640e84-6844-485f-9e93-1528b3a764b1/PvZ%20Themed%20Tower%20Defence/Build/UnityLoader.js:4:11057
abort (PvZ Themed Tower Defence.wasm.framework.unityweb:8:490661)
wasm-stub@[wasm code]
<?>.wasm-function[51035]@[wasm code]
<?>.wasm-function[27963]@[wasm code]
<?>.wasm-function[29407]@[wasm code]
<?>.wasm-function[25916]@[wasm code]
<?>.wasm-function[50801]@[wasm code]
wasm-stub@[native code]
blob:https://s3-us-west-2.amazonaws.com/2c6c7726-1c24-4200-8a05-a55bd759a769:8:464335
invoke_iiiii (PvZ Themed Tower Defence.wasm.framework.unityweb:8:337474)
<?>.wasm-function[50801]@[wasm code]
<?>.wasm-function[48927]@[wasm code]
<?>.wasm-function[48403]@[wasm code]
<?>.wasm-function[4586]@[wasm code]
<?>.wasm-function[4585]@[wasm code]
<?>.wasm-function[8086]@[wasm code]
<?>.wasm-function[8083]@[wasm code]
<?>.wasm-function[10433]@[wasm code]
<?>.wasm-function[8551]@[wasm code]
<?>.wasm-function[10859]@[wasm code]
<?>.wasm-function[10577]@[wasm code]
<?>.wasm-function[10577]@[wasm code]
<?>.wasm-function[10569]@[wasm code]
<?>.wasm-function[10563]@[wasm code]
<?>.wasm-function[50815]@[wasm code]
wasm-stub@[wasm code]
dynCall_v@[native code]
blob:https://s3-us-west-2.amazonaws.com/2c6c7726-1c24-4200-8a05-a55bd759a769:8:473045
browserIterationFunc (PvZ Themed Tower Defence.wasm.framework.unityweb:8:176038)
runIter (PvZ Themed Tower Defence.wasm.framework.unityweb:8:179103)
Browser_mainLoop_runner (PvZ Themed Tower Defence.wasm.framework.unityweb:8:177568)

Chrome:

An embedded page at s3-us-west-2.amazonaws.com says

An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
Uncaught abort(195) 
     at Error at jsStackTrace(PvZ Themed Tower 
Defence.wasm.framework.unityweb:8:22313)
    at stackTrace [Object.stackTrace] (PvZ Themed Tower
Defence.wasm.framework.unityweb:22484)
    at Object.onAbort (https://s3-us-west-2.amazonaws.com/sharemygame.com/dc640e84-6844-485f-9e93-1528b3a764b1/PvZ%20Themed%20Tower%20Defence/Build/
UnityLoader.js:4:11047)
    at abort (PvZ Themed Tower
Defence.wasm.framework.unityweb8:490661)
    at wasm-function[51035]:4 
    at wasm-function[27963]:48
    at wasm-function[29407]:154
    at wasm-function[25916]:16
    at wasm-function[50801]:20
    at dynCall_iiiii [Object.dynCall_iiiii] (PvZ Themed Tower
Defence.wasm.framework.unityweb:8:464330)
    at invoke_iiiii (PvZ Themed Tower 
Defence.wasm.framework.unityweb:8:337474)
    at wasm-function[48927]:137
    at wasm-function[48403]:36
    at wasm-function[4586]:64
    at wasm-function[4585]:109
    at wasm-function[8086]:2647

Firefox:

The page at https://s3-us-west-2.amazonaws.com says:


An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was:
uncaught exception: abort(195) at jsStackTrace (PvZ Themed Tower Defence.wasm.framework.unityweb:8:22313)
stackTrace (PvZ Themed Tower Defence.wasm.framework.unityweb:8:22484)
onAbort@https://s3-us-west-2.amazonaws.com/sharemygame.com/dc640e84-6844-485f-9e93-1528b3a764b1/PvZ%20Themed%20Tower%20Defence/Build/UnityLoader.js:4:11047
abort (PvZ Themed Tower Defence.wasm.framework.unityweb:8:490651)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[51035]:0x105b1f7 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[27963]:0xbe1fb7)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[29407]:0xc2e766 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[25916]:0xbad07a)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[50801]:0x105a536
UnityModule [UnityModule/Module.dynCall_iiiii] (PvZ Themed Tower Defence.wasm.framework.unityweb:8:464330)
invoke_iiiii (PvZ Themed Tower Defence.wasm.framework.unityweb:8:337458)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[48927]:0x1005d09 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[48403]:0xfeebc2)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[4586]:0x1dee2c (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[4585]:0x1ded5a)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[8086]:0x307ed1 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[8083]:0x3072a1)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10433]:0x407e59 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[8551]:0x33d4d6)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10859]:0x4390d3 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10577]:0x416a77)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10577]:0x416a8c (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10569]:0x415c6e)
@blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[10563]:0x4140b3 (blob:https://s3-us-west-2.amazonaws.com/cabe3d3a-9237-9447-9e65-f85e40f02865 line 8 > WebAssembly.instantiate:wasm-function[50815]:0x105a768)
UnityModule [UnityModule/Module.dynCall_v] (PvZ Themed Tower Defence.wasm.framework.unityweb:8:473040)
browserIterationFunc (PvZ Themed Tower Defence.wasm.framework.unityweb:8:176026)
runIter (PvZ Themed Tower Defence.wasm.framework.unityweb:8:179099)
Browser_mainLoop_runner (PvZ Themed Tower Defence.wasm.framework.unityweb:8:177561)

Oh my, I’ve linked the wrong thread. Sorry for the mistake. Nevertheless, thank you for the formatting. The error message is now easier to read.

The thread I meant is this one: WebGL Debugging

Did you implement your own ideas in your game? And have you tried to rebuild your game?

1 Like

Yes, I did try to implement an idea of my own. Basically, as the game progresses, enemies spawn faster.

Did the steps specified in the thread and I get these 5 errors in the JavaScript console:

Now I don’t know whether the game doesn’t run due to the null reference error or due to one of the other 4 errors since I got the same null reference error in Unity’s console, but the game still ran fine within Unity.

I also have no idea how to since I see no reason why the error should even exist in the first place.

Null error in Unity:

The null error happens in this script (I have underlined the important key parts that might be causing the error):

I have also correctly put everything into the serialized fields:

What’s more, the script works perfectly find and as intended despite the null error.

Is the null error causing the problem of the WebGL not working (if so, how would I fix that pesky null error) or are one of the 4 other errors the culprit?

waveNumber is of type int. It’s never null. waveText might be the problem. Does the Wave game object get destroyed at some point? Are there multiple EnemySpawner components in your Hierarchy?

1 Like

Yes, turns out I had an extraneous EnemySpanwer component causing the problem. Deleted that and now the error goes away. The game now runs in the browser, but (drumroll…) another bug appeared.

This time, the game runs but the game screen remains blank. Nothing shows on the game screen, and the UI only displays when the game is full screened:

How do I fix dis?

Did you set the anchors of the UI elements correctly?

1 Like

I guess I have. The 4 anchors are set on each corner of the canvas respectively. Also, I should point out that even though the screen remains black (this isn’t intended), I can hear the game sounds and music playing.

Could you share a screenshot of the Inspector of the bottom left UI element, please?

Here you go:

51%20PM

The anchor is not set to the bottom left corner. (0.5, 0.5) refers to the centre.

1 Like

But here, the anchors are set in the corners. I’ve circled them:

You marked four corners in your screenshot. I meant the bottom left only. The pivot point must be set to the bottom left corner, too.


See also:

Ah, the pivot point. Did that with the bottom left corner. Should I do that with the other UI elements too with their respective corners?

1 Like

Yes, you need to do that.

I usually do not use the scene window to design my GUIs but keep the game window open. Then I set the values in the Inspector. In my opinion, that’s much easier because I can see the result immediately, and I can test different resolutions.

Try the same. It might be a bit confusing at the beginning but once you grasped the idea, it makes sense. :slight_smile:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms