curlconverter / curlconverter

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

curlConverter for React #623

Closed BhojrajPathak001 closed 3 months ago

BhojrajPathak001 commented 3 months ago

I am getting this erros when i try to import import * as curConverter from 'curlconverter'

ERROR in ./node_modules/web-tree-sitter/tree-sitter.js 38:21-34 Module not found: Error: Can't resolve 'fs' in 'C:\Users\bhojraj pathak\Desktop\abcd\curlconverter\node_modules\web-tree-sitter'

ERROR in ./node_modules/web-tree-sitter/tree-sitter.js 39:25-40 Module not found: Error: Can't resolve 'path' in 'C:\Users\bhojraj pathak\Desktop\abcd\curlconverter\node_modules\web-tree-sitter'

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it.

If you want to include a polyfill, you need to:

ERROR in ./node_modules/yamljs/lib/Utils.js 250:11-20 Module not found: Error: Can't resolve 'fs' in 'C:\Users\bhojraj pathak\Desktop\abcd\curlconverter\node_modules\yamljs\lib'

verhovsky commented 3 months ago

Please take a look at the webpack.config.js for curlconverter.com

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

Specifically, you'll need these lines

https://github.com/curlconverter/curlconverter.github.io/blob/25440e4361ab53fa845b586e086b653d6f4f5efa/webpack.config.js#L122-L133

and to install them

https://github.com/curlconverter/curlconverter.github.io/blob/25440e4361ab53fa845b586e086b653d6f4f5efa/package.json#L17-L31