opencascade.js icon indicating copy to clipboard operation
opencascade.js copied to clipboard

Error initializing custom build

Open MattFerraro opened this issue 1 year ago • 2 comments

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 avatar Aug 12 '22 18:08 MattFerraro

@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.

martinRenou avatar Nov 14 '23 10:11 martinRenou

Hello @MattFerraro, Have you been able to resolve this problem?

The same error is appearing for me on the same line.

ketanvariya avatar Feb 01 '24 13:02 ketanvariya