curlconverter / curlconverter

Transpile curl commands into Python, JavaScript and 27 other languages
https://curlconverter.com
MIT License
7.17k stars 867 forks source link

[Error]: WebAssembly issue. #605

Open MarketingPip opened 5 months ago

MarketingPip commented 5 months ago

Can not seem to get things working - do not know if my environment etc? (inside iframe & can not set package.json)

"Aborted(both async and sync fetching of the wasm failed)"
"failed to asynchronously prepare wasm: RuntimeError: Aborted(both async and sync fetching of the wasm failed). Build with -sASSERTIONS for more info."
"Aborted(RuntimeError: Aborted(both async and sync fetching of the wasm failed). Build with -sASSERTIONS for more info.)"

Would be great for proper example of usage via import in browser plus proper build to use.

verhovsky commented 5 months ago

Look at the webpack.config.json file for curlconverter.com:

https://github.com/curlconverter/curlconverter.github.io/blob/master/webpack.config.js

MarketingPip commented 5 months ago

@verhovsky - can I suggest that if not imported etc you look for these via script tag in window (if window is defined). Then throw error if not found. (in window & in node modules).

Tho when using the "built" version from "esm.sh" - this error still throws. (Which in the online build - it should also be automatically imported / added to the build).

MarketingPip commented 5 months ago

@verhovsky - just looking over. What about possibly using as dynamic import in browser if not in window? Then if in window use a basic typeof check to validate its the proper WASM files needed?

(just a thought)

verhovsky commented 5 months ago

I don't understand what you're suggesting.

MarketingPip commented 5 months ago

@verhovsky when using a build from say ESM.sh (cdn). These will / were not resolving properly.

As well - possibly a variable / way to DEFINE the path you want to use for WASM might be ideal. 👌