ted537 / tsembind

Generate typescript bindings for Embind projects
25 stars 3 forks source link

require() of ES Module from tsembind/src/tsembind.js not supported. #8

Open marcofugaro opened 3 years ago

marcofugaro commented 3 years ago

Screenshot 2021-09-17 at 15 08 16

I am trying to use this library with an EXPORT_ES6 library, the flags I build the library are

    -s MODULARIZE \
    -s EXPORT_ES6 \
    -s ENVIRONMENT='web' \
    -s USE_ES6_IMPORT_META=0 \

And my library ends with:

export default Module;

I also have type="module" in my package.json.

ted537 commented 3 years ago

Yeah there should be a test in here that binds a simple void function with -s EXPORT_ES6. Looking into it.

ted537 commented 3 years ago

Have you tried disabling the ES6 / web specific flags and running TSEMBIND on the JS/WASM produced from that?