diff --git a/web/packages/core/src/ruffle-player.ts b/web/packages/core/src/ruffle-player.ts index 358abff3c..a9d97d674 100644 --- a/web/packages/core/src/ruffle-player.ts +++ b/web/packages/core/src/ruffle-player.ts @@ -28,6 +28,7 @@ enum PanicError { Unknown, CSPConflict, FileProtocol, + InvalidWasm, JavascriptConfiguration, JavascriptConflict, WasmCors, @@ -390,6 +391,11 @@ export class RufflePlayer extends HTMLElement { e.ruffleIndexError = PanicError.WasmCors; } else if (message.includes("disallowed by embedder")) { e.ruffleIndexError = PanicError.CSPConflict; + } else if ( + message.includes("WebAssembly.instantiate") && + e.name === "CompileError" + ) { + e.ruffleIndexError = PanicError.InvalidWasm; } else if ( !message.includes("magic") && (e.name === "CompileError" || e.name === "TypeError") @@ -1053,6 +1059,18 @@ export class RufflePlayer extends HTMLElement {
  • View Error Details
  • `; break; + case PanicError.InvalidWasm: + // Self hosted: Cannot load `.wasm` file - incorrect configuration or missing files + errorBody = ` +

    Ruffle has encountered a major issue whilst trying to initialize.

    +

    It seems like this page has missing or invalid files for running Ruffle.

    +

    If you are the server administrator, please consult the Ruffle wiki for help.

    + `; + errorFooter = ` +
  • View Ruffle Wiki
  • +
  • View Error Details
  • + `; + break; case PanicError.JavascriptConflict: // Self hosted: Cannot load `.wasm` file - a native object / function is overriden errorBody = `