Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with node-fetch 3.3.1 version #1747

Open
fengnian7 opened this issue May 25, 2023 · 0 comments
Open

Issue with node-fetch 3.3.1 version #1747

fengnian7 opened this issue May 25, 2023 · 0 comments
Labels

Comments

@fengnian7
Copy link

When I update the node-fetch to 3.3.1 version, I had some errors executing the compile command "npm run watch"

 ERROR in ./node_modules/node-fetch/src/body.js
 Module not found: Error: Can't resolve 'node:buffer' in 'node_modules\node-fetch\src'
 @ ./node_modules/node-fetch/src/body.js 10:0-35 42:10-16 45:13-19 49:10-16 52:10-16 62:10-16 67:6-12 209:9-15 214:9-15 
241:11-17 244:10-16 324:5-11 369:5-11
 @ ./node_modules/node-fetch/src/index.js

Then I checked some similar problems of others before, but did not find a solution, then I used the custom loader to solve this error, but then there was another error as shown below。

ERROR in ./node_modules/fetch-blob/index.js 45:2
Module parse failed: Unexpected character '#' (45:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|   /** @type {Array.<(Blob|Uint8Array)>} */
>   #parts = []
|   #type = ''
|   #size = 0
 @ ./node_modules/node-fetch/src/body.js 12:0-30 137:13-17
 @ ./node_modules/node-fetch/src/index.js
 @ ./src/server/launch/main.js

ERROR in ./node_modules/fetch-blob/from.js 60:2
Module parse failed: Unexpected character '#' (60:2)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|  */
| class BlobDataItem {
>   #path
|   #start
|
 @ ./node_modules/node-fetch/src/index.js 27:0-34:28 37:0-68 37:0-68 37:0-68 37:0-68 37:0-68 37:0-68
 @ ./src/server/launch/main.js

This error appears to be caused by the # symbol being used in other node-fetch dependent software code, causing webpack to fail to parse.

Reproduction

Expected behavior
I use node-fetch@2.6.7 can build success, but not working in node-fetch@3.3.1, I expect it can work.

Screenshots

image

Your Environment

software version
node-fetch v3.3.1
node v18.14.1
npm v9.6.4
Operating System Windows 10

Additional context

For these two problems, I have found similar ones in the problem list, but I still cannot find an effective way to solve the compilation error. So excuse me, is there any solution plan or method you can provide? Thank you

@fengnian7 fengnian7 added the bug label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant