# VTK 9.5.0 WebAssembly 64-bit build fails with BigInt conversion error

**URL:** https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794
**Category:** Support
**Tags:** vtkwasm
**Created:** [July 8, 2025, 9:32am UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794 "2025-07-08T09:32:05Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![leehyeonseop](https://discourse.vtk.org/user_avatar/discourse.vtk.org/leehyeonseop/32/10108_2.png) [@leehyeonseop](https://discourse.vtk.org/u/leehyeonseop)
#### Post date: [July 8, 2025, 9:32am UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/1 "2025-07-08T09:32:05Z")

</div>

Hello, I’m trying to build VTK 9.5.0 with WebAssembly 64-bit support following the official documentation, but I’m encountering a BigInt conversion error during the build process.

**Special Note:** Initially, the build was using Emscripten’s bundled Node.js, so I modified the `.emscripten` file to point to my system’s Node.js v23.8.0 instead.

**Environment:**

- VTK: 9.5.0
- CMake: 3.31
- Emscripten: 4.0.3
- Node.js: v23.8.0
- OS: Windows 11
- Build system: Ninja

**Build Configuration:**

bash

```auto
emcmake cmake \
    -S .. \
    -B . \
    -G "Ninja" \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_SHARED_LIBS:BOOL=OFF \
    -DVTK_WEBASSEMBLY_THREADS:BOOL=ON \
    -DVTK_WEBASSEMBLY_EXCEPTIONS:BOOL=ON \
    -DVTK_WEBASSEMBLY_64_BIT:BOOL=ON

```

**Error:** During the build, when trying to generate the wrap hierarchy for VTK::CommonCore, I get:

```auto
[1134/4962] Generating the wrap hierarchy for VTK::CommonCore
FAILED: lib/vtk-9.5/hierarchy/VTK/vtkCommonCore-hierarchy.txt
...
TypeError: Cannot convert a BigInt value to a number
    at Object. (D:\dev\vtk-07-08\VTK-9.5.0\build\bin\vtkWrapHierarchy-9.5.js:1:6880)
    at Module._compile (node:internal/modules/cjs/loader:1734:14)
    ...
Node.js v23.8.0

```

The build system is trying to run `vtkWrapHierarchy-9.5.js` with Node.js using the `--experimental-wasm-memory64` flag, but it fails with a BigInt conversion error.

**Question:** Is this a known issue with VTK 9.5.0’s WebAssembly 64-bit build? The documentation mentions 64-bit support, but it seems the build tools themselves have issues running in 64-bit mode. Should the build tools (like vtkWrapHierarchy) be compiled in 32-bit mode while keeping the actual VTK libraries in 64-bit?

Any guidance would be greatly appreciated. Thank you!

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 8, 2025, 2:14pm UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/2 "2025-07-08T14:14:02Z")

</div>

Please use node \>= 24.0.0. See [Building VTK | VTK.wasm](https://kitware.github.io/vtk-wasm/guide/cpp/setup.html) for a complete guide.

---

<div class="post-metadata">

### Author: ![leehyeonseop](https://discourse.vtk.org/user_avatar/discourse.vtk.org/leehyeonseop/32/10108_2.png) [@leehyeonseop](https://discourse.vtk.org/u/leehyeonseop)
#### Post date: [July 10, 2025, 4:25am UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/3 "2025-07-10T04:25:28Z")

</div>

Thank you so much! I really appreciate your help.

---

<div class="post-metadata">

### Author: ![leehyeonseop](https://discourse.vtk.org/user_avatar/discourse.vtk.org/leehyeonseop/32/10108_2.png) [@leehyeonseop](https://discourse.vtk.org/u/leehyeonseop)
#### Post date: [July 10, 2025, 6:41am UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/5 "2025-07-10T06:41:14Z")

</div>

Thank you for your guidance - I successfully built VTK with 64-bit following your instructions. I really appreciate your help. However, when I tried to build the cone example, I encountered an issue.

I successfully configured the build using emcmake with these flags:

```auto
-DCMAKE_C_FLAGS="-sMEMORY64" -DCMAKE_CXX_FLAGS="-sMEMORY64"

```

But when I run `cmake --build build`, I get the following error. How can I resolve this?

```auto
PS D:\dev\vtk-07-09\Examples\Emscripten\Cxx\HsCone> cmake --build build
[1/1] Linking CXX executable D:\dev\vtk-07-09\Examples\docs\public\demo\cpp-app-1\main.js
FAILED: D:/dev/vtk-07-09/Examples/docs/public/demo/cpp-app-1/main.js
C:\WINDOWS\system32\cmd.exe /C "cd . && D:\dev\vtk-07-09\emsdk\upstream\emscripten\em++.bat -sMEMORY64 -g -lembind -sALLOW_MEMORY_GROWTH=1 -sSINGLE_FILE=1 -sASSERTIONS=1 -O0 -g3 -fwasm-exceptions -sEXCEPTION_STACK_TRACES=1 -pthread -sMEMORY64=1 -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE=$getWasmTableEntry --js-library=D:/dev/vtk-07-09/installRelease/lib/vtkWebAssemblyRenderWindowInteractor.js --js-library=D:/dev/vtk-07-09/installRelease/lib/vtkEmscriptenTestUtilities.js --use-port=emdawnwebgpu -s FULL_ES3=1 -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2 @CMakeFiles\main.rsp -o D:\dev\vtk-07-09\Examples\docs\public\demo\cpp-app-1\main.js && cd ."
em++: warning: -pthread + ALLOW_MEMORY_GROWTH may run non-wasm code slowly, see https://github.com/WebAssembly/design/issues/1271 [-Wpthreads-mem-growth]
error: handleI64Signatures: signature too long for emwgpuWaitAny
Error: Aborting compilation due to previous errors
em++: error: ''C:\Users\User\AppData\Local\fnm_multishells\28136_1752129150499\node.EXE' 'D:\dev\vtk-07-09\emsdk\upstream\emscripten\tools\compiler.mjs' -' failed (returned 1)
ninja: build stopped: subcommand failed.

```

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 14, 2025, 1:49pm UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/6 "2025-07-14T13:49:04Z")

</div>

This does not look to be the [Cone](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Examples/Emscripten/Cxx/Cone/CMakeLists.txt?ref_type=heads) example. Did you modify it? Are you finding VTK with `find_package(VTK)` or component-based `find_package(VTK COMPONENTS ...)`? It seems to be linking with the RenderingWebGPU module. It fails because webgpu needs `-sJSPI=1` and you do not have that link flag.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [July 21, 2025, 12:19pm UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/7 "2025-07-21T12:19:10Z")

</div>

> [@jaswantp](#):
>
> It fails because webgpu needs `-sJSPI=1` and you do not have that link flag.

Where should that usage requirement be added?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [July 21, 2025, 1:13pm UTC](https://discourse.vtk.org/t/vtk-9-5-0-webassembly-64-bit-build-fails-with-bigint-conversion-error/15794/8 "2025-07-21T13:13:22Z")

</div>

As of today, it should be added by consumers. In the future, RenderingWebGPU will have it in `INTERFACE`. RenderingWebGPU does not include that flag right now because JSPI is not standardized [yet](https://webassembly.org/features/). That give users freedom to choose legacy `-sASYNCIFY=1` in order to support browsers that do not have JSPI (like Safari and non-nightly firefox)
