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.
Error: During the build, when trying to generate the wrap hierarchy for VTK::CommonCore, I get:
[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!
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:
This does not look to be the Cone 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.
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. 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)