Skip to content

wasmMemory.toResizableBuffer is not a function #26099

Closed

Description

@idranme

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 4.0.23 (7a5d93b50f6a3a35e85a0d2fc9e667b8498e6aed)
clang version 22.0.0git (https:/github.com/llvm/llvm-project 5243501cca02d7e54294d4bb5de0a85b06c40b7d)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: E:\emsdk\upstream\bin

Failing command line in full:

C:\Windows\system32\cmd.exe /C "cd . && E:\emsdk\upstream\emscripten\em++.bat -Wall -O3 -msimd128 -flto -lembind -pthread -sALLOW_MEMORY_GROWTH -sGROWABLE_ARRAYBUFFERS -sMODULARIZE -sEXPORT_ES6 -sINVOKE_RUN=0 --closure 1 --emit-tsd silk.d.ts CMakeFiles/silk.dir/src/index.cpp.o -o silk.js -LE:/silk-wasm/binding libsilk_native.a && cd ."
em++: warning: -sGROWABLE_ARRAYBUFFERS is experimental and not yet supported in browsers [-Wexperimental]
C:\Users\withy\AppData\Local\Temp\emscripten_temp_iqxmqmya\tsgen.js:491
  var b = wasmMemory.toResizableBuffer();
                     ^

TypeError: wasmMemory.toResizableBuffer is not a function
    at updateMemoryViews (C:\Users\withy\AppData\Local\Temp\emscripten_temp_iqxmqmya\tsgen.js:491:22)
    at initMemory (C:\Users\withy\AppData\Local\Temp\emscripten_temp_iqxmqmya\tsgen.js:549:3)
    at Object.<anonymous> (C:\Users\withy\AppData\Local\Temp\emscripten_temp_iqxmqmya\tsgen.js:2477:3)
    at Module._compile (node:internal/modules/cjs/loader:1730:14)
    at Object..js (node:internal/modules/cjs/loader:1895:10)
    at Module.load (node:internal/modules/cjs/loader:1465:32)
    at Function._load (node:internal/modules/cjs/loader:1282:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)

Full link command and output with -v appended:

C:\Windows\system32\cmd.exe /C "cd . && E:\emsdk\upstream\emscripten\em++.bat -Wall -O3 -msimd128 -flto -lembind -pthread -sALLOW_MEMORY_GROWTH -sGROWABLE_ARRAYBUFFERS -sMODULARIZE -sEXPORT_ES6 -sINVOKE_RUN=0 --closure 1 --emit-tsd silk.d.ts -v CMakeFiles/silk.dir/src/index.cpp.o -o silk.js -LE:/silk-wasm/binding libsilk_native.a && cd ."
 "E:/emsdk/upstream/bin\clang.exe" --version
em++: warning: -sGROWABLE_ARRAYBUFFERS is experimental and not yet supported in browsers [-Wexperimental]
 "E:/emsdk/upstream/bin\wasm-ld.exe" -o silk.wasm 'C:\Users\withy\AppData\Local\Temp\tmpacsz1jtclibemscripten_js_symbols.so' --import-memory --shared-memory --strip-debug -u__cxa_atexit --export=_emscripten_stack_alloc --export=__getTypeName --export=_embind_initialize_bindings --export=_emscripten_thread_free_data --export=_emscripten_thread_crashed --export=__wasm_call_ctors --export=_emscripten_tls_init --export=_emscripten_thread_init --export=emscripten_stack_get_current --export=_emscripten_stack_restore --export=emscripten_stack_set_limits --export=_emscripten_thread_exit --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=main --export-if-defined=__main_argc_argv --export-table -z stack-size=65536 --max-memory=2147483648 --initial-memory=16777216 --no-entry --no-stack-first --table-base=1 --global-base=1024 -lembind-mt-rtti CMakeFiles/silk.dir/src/index.cpp.o -LE:/silk-wasm/binding libsilk_native.a '-LE:\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\lto' '-LE:\emsdk\upstream\emscripten\src\lib' 'E:\emsdk\upstream\emscripten\cache\sysroot\lib\wasm32-emscripten\lto\crtbegin.o' -lGL-mt-getprocaddr -lal -lhtml5 -lstubs -lnoexit -lc-mt -ldlmalloc-mt -lcompiler_rt-mt -lc++-mt-noexcept -lc++abi-mt-noexcept -lsockets-mt -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr
 "E:/emsdk/upstream/bin\llvm-objcopy.exe" silk.wasm silk.wasm '--remove-section=.debug*' --remove-section=producers --remove-section=name
 "E:/emsdk/node/22.16.0_64bit/bin/node.exe" 'E:\emsdk\upstream\emscripten\tools\compiler.mjs' -
 "E:/emsdk/node/22.16.0_64bit/bin/node.exe" 'E:\emsdk\upstream\emscripten\tools\compiler.mjs' -
 "E:/emsdk/node/22.16.0_64bit/bin/node.exe" 'C:\Users\withy\AppData\Local\Temp\emscripten_temp_b800gow1\tsgen.js' 'C:\Users\withy\AppData\Local\Temp\emscripten_temp_b800gow1\embind_generated_output.js'

Activity

  1. sbc100 commented on Jan 13, 2026

    @sbc100
    Collaborator

    Hmm, I guess we need to disable GROWABLE_ARRAYBUFFERS when to do the TS-generation build. @brendandahl ?

  2. brendandahl commented on Jan 14, 2026

    @brendandahl
    Collaborator

    Yeah, this is yet another setting we need to ignore. I'm toying with the idea of doing the opposite what we currently do and block certain settings and instead do more of an allow list of settings. i.e. reset all the settings to the defaults and then preserving the relevant ones that would cause different TS output.

  3. kleisauke commented on May 23, 2026

    @kleisauke
    Collaborator

    FWIW, upgrading to Node.js 26 would also fix this (see e.g. PR #27003 for details).

  4. added a commit that references this issue on Jun 12, 2026
    99c29da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions