Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to properly load the full wasm package from opencascade and/or see better errors #156

Open
tsdexter opened this issue Apr 20, 2024 · 0 comments

Comments

@tsdexter
Copy link

I'm having trouble loading the full OC wasm. I've changed my worker like:

// import opencascadeWasm from 'replicad-opencascadejs/src/replicad_single.wasm?url';
import opencascadeWasm from 'opencascade.js/dist/opencascade.full.wasm?url';

and now I get the error:

comlink.js?v=2496509d:42 Uncaught (in promise) RuntimeError: Aborted(LinkError: WebAssembly.instantiate(): Import #68 module="a" function="oa": function import requires a callable). Build with -sASSERTIONS for more info.
    at abort (replicad-opencascade…s?v=2496509d:501:15)
    at replicad-opencascade…s?v=2496509d:578:11

Really, my end goal isn't necessarily to have the full wasm library, but just to get better errors than:

image

Which I thought the error message is so basic due to the note on the opencascadejs site, but I don't see the sDISABLE_EXCEPTION_CATCHING flag in the build config. Am I just doing something wrong for getting the errors?

DISABLING EXCEPTIONS GREATLY REDUCES FILE SIZE
For many applications, exception support is not required in OpenCascade.js and can be disabled. For a full build, this reduces the file size by ~45% and greatly improves performance (even if exceptions are never thrown). Pass -sDISABLE_EXCEPTION_CATCHING=1 in the emccFlags of your custom build to disable exceptions. Check out this custom build definition for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant