BindingError: emval::as has unknown type j
-
I get this error in my browser when the .wasm file is loading, causing it to fail to load.
(Qt 6.9.3 + emsdk 3.1.70 + qmake)
Through lots of trial and error, I figured out that it's happening when using emscripten::val, or maybe EM_JS, in a .cpp file that is located in a subfolder (relative to the .pro file). Moving the file up to the main directory yields a wasm file that works normally.
Has anyone seen this and have any more details on what's causing it and what is a better fix than moving the file? My .pro file is pretty basic and I don't see any reason the location of the file should matter.
-
Try an unoptimized build first (without optimizations) to verify a code folding/LTO issue, and if so, update emsdk to a newer version; if you don't feel like messing with it, moving the file is the quick fix.