tomas / needle

Nimble, streamable HTTP client for Node.js. With proxy, iconv, cookie, deflate & multipart support.
https://www.npmjs.com/package/needle
MIT License
1.63k stars 236 forks source link

Issue with webpack and react-native #388

Open ssshammi opened 2 years ago

ssshammi commented 2 years ago

I am making a admin backend server with rest APIs and then i make this client side app using react. I got tons of error when using webpack I do not know how to configure webpack but this is not an issue with working with axios. But i think i understand needle But now i think I am lost do i need to install more dependency. because i do not have webpack config file and i dont want to create one

`Compiled with problems:X

ERROR in ./node_modules/needle/lib/auth.js 1:17-45

Module not found: Error: Can't resolve 'crypto' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/cookies.js 8:15-46

Module not found: Error: Can't resolve 'querystring' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib' Did you mean './querystring'? Requests that should resolve in the current directory need to start with './'. Requests that start with a name are treated as module requests and resolve within module directories (node_modules, C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules). If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.

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/needle/lib/decoder.js 2:15-39

Module not found: Error: Can't resolve 'util' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/decoder.js 3:13-30

Module not found: Error: Can't resolve 'stream' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/multipart.js 1:15-37

Module not found: Error: Can't resolve 'fs' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

ERROR in ./node_modules/needle/lib/multipart.js 2:15-39

Module not found: Error: Can't resolve 'path' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/needle.js 7:9-22

Module not found: Error: Can't resolve 'fs' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

ERROR in ./node_modules/needle/lib/needle.js 8:11-26

Module not found: Error: Can't resolve 'http' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/needle.js 9:12-28

Module not found: Error: Can't resolve 'https' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/needle.js 10:10-24

Module not found: Error: Can't resolve 'url' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/needle.js 11:13-30

Module not found: Error: Can't resolve 'stream' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/needle.js 32:45-68

Module not found: Error: Can't resolve 'util' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/needle/lib/parsers.js 5:16-43

Module not found: Error: Can't resolve 'stream' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\needle\lib'

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/safer-buffer/safer.js 4:13-30

Module not found: Error: Can't resolve 'buffer' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\safer-buffer'

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/string_decoder/node_modules/safe-buffer/index.js 4:13-30

Module not found: Error: Can't resolve 'buffer' in 'C:\v360PlasticProjects\Local\local_Prototype\VRInsightFrontend\vr360insightweb\node_modules\string_decoder\node_modules\safe-buffer'

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:

`

Elben9 commented 1 year ago

in webpack5 project, how to fix : Can't resolve 'fs' in 'xxxxxxxx\node_modules\needle\lib'