Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Fixed: Unity 2020, 2021 WebGL builds fail to run in itch app

A topic by wcoastsands created May 09, 2021 Views: 682 Replies: 1
Viewing posts 1 to 2
(3 edits) (+2)

This issue is specific to the itch app, and occurs when launching WebGL builds made with Unity 2020 and 2021 (Decompression Fallback enabled). 

The following errors appear under the JavaScript Console tab in Developer Tools (press Shift+F12 after launching the game):

SnapWords.loader.js:1 failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder 
SnapWords.loader.js:1 CompileError: WebAssembly.instantiate(): Wasm code generation disallowed by embedder at blob:itch-cave://game.itch/5a05f7d0-ceae-49fc-8481-c88094ce1483:2:24961

This appears to be a Content Security Policy (CSP) issue with the Chromium integration in the itch app.

Examples:

This issue does not occur with WebGL builds made with Unity 2019:

navigator.appVersion
"5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) itch/25.4.1 Chrome/85.0.4183.84 Safari/537.36"

Issue appears to be resolved with the latest version 25.5.1.