tomas / tomas/needle

Issue with webpack and react-native

Open
#388 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.6k
Forks
237
PR merge metrics
No merged PRs in 30d

Description

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:
- add a fallback 'resolve.fallback: { "crypto": require.resolve("crypto-browserify") }'
- install 'crypto-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "crypto": false }

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:
- add a fallback 'resolve.fallback: { "querystring": require.resolve("querystring-es3") }'
- install 'querystring-es3'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "querystring": false }

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:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

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:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }

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:
- add a fallback 'resolve.fallback: { "path": require.resolve("path-browserify") }'
- install 'path-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "path": false }

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:
- add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }'
- install 'stream-http'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "http": false }

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:
- add a fallback 'resolve.fallback: { "https": require.resolve("https-browserify") }'
- install 'https-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "https": false }

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:
- add a fallback 'resolve.fallback: { "url": require.resolve("url/") }'
- install 'url'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "url": false }

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:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }

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:
- add a fallback 'resolve.fallback: { "util": require.resolve("util/") }'
- install 'util'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "util": false }

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:
- add a fallback 'resolve.fallback: { "stream": require.resolve("stream-browserify") }'
- install 'stream-browserify'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "stream": false }

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:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }

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:
- add a fallback 'resolve.fallback: { "buffer": require.resolve("buffer/") }'
- install 'buffer'
If you don't want to include a polyfill, you can use an empty module like this:
resolve.fallback: { "buffer": false }

`

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported client-side webpack build and inspect the listed modules under node_modules/needle/lib, including auth.js, cookies.js, decoder.js, multipart.js, needle.js, and parsers.js. The report names no repository files, webpack configuration, or tests; done would require an agreed browser-bundling approach that resolves the reported build errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, react-native, webpack
Domain
build-system, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.