emscripten-core/emscripten

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

Open

#27,156 创建于 2026年6月21日

在 GitHub 查看
 (16 评论) (0 反应) (0 负责人)C++ (3,519 fork)batch import
help wanted

仓库指标

Star
 (27,361 star)
PR 合并指标
 (平均合并 19天 10小时) (30 天内合并 147 个 PR)

描述

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

贡献者指南