Skip to content

WebAssembly.instantiate(): illegal flag value 90 @+642213 when -sSINGLE_FILE=1 in release build #27156

Description

@sefyan0hack

when using -sSINGLE_FILE=1 in Release i get this Error in the browser console dev tool

failed to asynchronously prepare wasm: CompileError: WebAssembly.instantiate(): illegal flag value 90 @+642213
index.html:1 Uncaught (in promise) TypeError: A.startsWith is not a function
    at isFileURI (index.html:1:4330)
    at instantiateArrayBuffer (index.html:1:9272375)
    at async createWasm (index.html:1:9273430)

index.html:1:4330 is var isFileURI = A => A.startsWith("file://");

Version of emscripten/emsdk:

GameEngine\build>emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 6.0.0 (afa15e0c56d1292e073c2c91bafc1d5e0cdf0dd3)
clang version 23.0.0git (https:/github.com/llvm/llvm-project c6c2ad52586c28e74a724570985a48dc0022d250)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: C:\emsdk\upstream\bin

Emscripten compile/link flags

target_link_libraries(Engine PUBLIC
       $<$<PLATFORM_ID:Emscripten>:
            --shell-file ${CMAKE_SOURCE_DIR}/cmake/index.html
            -sMIN_WEBGL_VERSION=2
            -sFULL_ES3=1

            -sALLOW_MEMORY_GROWTH=1

            -sDISABLE_EXCEPTION_THROWING=0
            -sDISABLE_EXCEPTION_CATCHING=0

	        -sSINGLE_FILE=1
            -sASSERTIONS=2

            $<$<CONFIG:Debug>:
                -sEXCEPTION_STACK_TRACES=1
                -sSTACK_OVERFLOW_CHECK=2
                -sSAFE_HEAP=1
                -sGL_ASSERTIONS=1
                -sGL_DEBUG=1
                -gsource-map
            >
        >
)

project: https://github.com/sefyan0hack/GameEngine
hosted on github pages: https://sefyan0hack.github.io/GameEngine/Release

index.html

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions