opencascade.js
opencascade.js copied to clipboard
Error initializing custom build
I followed the instructions here for building my own custom build, but I used the build definition given here.
The build went fine, but then when I go to use it:
import initOpenCascade from "opencascade.js"
import opencascade from './customBuild/customBuild.examples.js';
import opencascadeWasm from './customBuild/customBuild.examples.wasm';
initOpenCascade({
mainJs: opencascade,
mainWasm: opencascadeWasm,
}).then((newOC) => {
console.log("wasm is initialized!")
})
The console shows me an error:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'buffer')
at receiveInstance (opencascade.full.js:9:1)
at receiveInstantiationResult (opencascade.full.js:9:1)
Expected behavior is that opencascade initializes properly. It does init properly if I omit my custom mainJs
and mainWasm
, it just takes 5 seconds or so, hence my need for a custom build.
@MattFerraro I can reproduce this error when using - -sDISABLE_EXCEPTION_CATCHING=0
in the custom build emccFlags, when setting this to -sDISABLE_EXCEPTION_CATCHING=1
it does work. I'm unsure what is going on though.
Hello @MattFerraro, Have you been able to resolve this problem?
The same error is appearing for me on the same line.