curlconverter / curlconverter

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

TypeError: Failed to fetch in electron #531

Open afeichuanqi opened 1 year ago

afeichuanqi commented 1 year ago

image

I have never been able to use these two files in my electric, which hinders me from putting them in the webpack configuration according to the instructions, but still cannot be found

verhovsky commented 1 year ago

curlconverter needs to be an ES Module (ESM) because of this top-level await statement:

https://github.com/curlconverter/curlconverter/blob/6f05690118dfaa40f931667d79101ff7091ea2e0/src/shell/webParser.ts#L7

Electron doesn't support ESM

https://github.com/curlconverter/curlconverter-vscode/issues/1

https://github.com/electron/electron/issues/21457

though the error you're getting is something different, but you won't be able to use curlconverter version 4+ in electron even if you figure out this error.