-
Notifications
You must be signed in to change notification settings - Fork 30
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
Error related to fetch.js and Webpack #277
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Hello there, @ottpeter, Were you able to find a fix for this? |
I am facing the same error while using the latest version of ipfs-http-client in my nextjs application as it is using ipfs-utils. My application is running but with errors in the terminal that fails the build process so I ain't able to deploy my application. Please resolve it as soon as possible Here is my github project link that's using ipfs-utils. https://github.com/niteshagnihotri/Fund-Allocation-System |
No, but it turned out it's just a warning, not an error. |
But i am unable to deploy the application on vercel because yarn build
fails every time.
…On Thu, 2 Nov 2023, 14:24 Peter Ott, ***@***.***> wrote:
No, but it turned out it's just a warning, not an error.
—
Reply to this email directly, view it on GitHub
<#277 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATKDLMIXWD5B5VASEOD36L3YCNNS5AVCNFSM6AAAAAA3XEVVAKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJQGMYTCNZTGQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
any fix??? |
Hey, so this could be solved in Node.js 18 and 20, where |
im facing the same issue, am on Node v21 and nextjs 14. is there no fix for this? |
Here's the fix that worked for me in Next.js |
hey thanks for the reply and suggestion. it worked for me on localhost now. seems like quite a janky fix to manually overwrite the fetch.js files in the node_modules ipfs-utils library. While this works on localhost, it would fail during any deployment as during build time on any platform would npm install the dependencies without doing the manual overwrite. Did you manage to find a fix for deployment? |
did you try the next.config fix?? |
I'm facing a similar issue with a project that depends on
The depreciation of the original IPFS libraries is a real shame. |
I'm facing this exact error when trying to use a package that depends on
I've tried adding |
I'm getting an error in Next.js, which is using ipfs-utils at some point. ipfs-utisl is imported by co2-storage.
I tried changing the line const fetch = require(implName) to const fetch = require('./fetch.node'), but it didn't help.
Import trace for requested module:
./node_modules/ipfs-utils/src/http/fetch.js
./node_modules/ipfs-utils/src/http.js
./node_modules/ipfs-http-client/src/files/rm.js
./node_modules/ipfs-http-client/src/files/index.js
./node_modules/ipfs-http-client/src/index.js
./node_modules/@co2-storage/js-api/src/js/storage/FGStorage.js
./node_modules/@co2-storage/js-api/src/js/index.js
./app/api/create-action-plan/route.ts
at webpackEmptyContext (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:22:10)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-utils/src/http/fetch.js:14:118)
at (rsc)/./node_modules/ipfs-utils/src/http/fetch.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:2173:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-utils/src/http.js:2:37)
at (rsc)/./node_modules/ipfs-utils/src/http.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:2151:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-http-client/src/lib/core.js:11:80)
at (rsc)/./node_modules/ipfs-http-client/src/lib/core.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:8012:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-http-client/src/lib/configure.js:5:66)
at (rsc)/./node_modules/ipfs-http-client/src/lib/configure.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:8001:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-http-client/src/bitswap/wantlist.js:6:75)
at (rsc)/./node_modules/ipfs-http-client/src/bitswap/wantlist.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:7253:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-http-client/src/bitswap/index.js:5:70)
at (rsc)/./node_modules/ipfs-http-client/src/bitswap/index.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:7209:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/ipfs-http-client/src/index.js:18:75)
at (rsc)/./node_modules/ipfs-http-client/src/index.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:7880:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/@co2-storage/js-api/src/js/storage/FGStorage.js:5:74)
at (rsc)/./node_modules/@co2-storage/js-api/src/js/storage/FGStorage.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:4250:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/@co2-storage/js-api/src/js/index.js:7:79)
at (rsc)/./node_modules/@co2-storage/js-api/src/js/index.js (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:4239:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./app/api/create-action-plan/route.ts:8:77)
at (rsc)/./app/api/create-action-plan/route.ts (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:282:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Fcreate-action-plan%2Froute&page=%2Fapi%2Fcreate-action-plan%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fcreate-action-plan%2Froute.ts&appDir=%2Fhome%2Fwebdev%2Fnftreesbrasil%2Fnextjs%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2Fhome%2Fwebdev%2Fnftreesbrasil%2Fnextjs&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!:16:127)
at (rsc)/./node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Fcreate-action-plan%2Froute&page=%2Fapi%2Fcreate-action-plan%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Fcreate-action-plan%2Froute.ts&appDir=%2Fhome%2Fwebdev%2Fnftreesbrasil%2Fnextjs%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2Fhome%2Fwebdev%2Fnftreesbrasil%2Fnextjs&isDev=true&tsconfigPath=tsconfig.json&basePath=&assetPrefix=&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D! (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:260:1)
at webpack_require (/home/webdev/nftreesbrasil/nextjs/.next/server/webpack-runtime.js:33:43)
at webpack_exec (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:12059:39)
at /home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:12060:28
at Object. (/home/webdev/nftreesbrasil/nextjs/.next/server/app/api/create-action-plan/route.js:12063:3)
at Module._compile (node:internal/modules/cjs/loader:1233:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at requirePage (/home/webdev/nftreesbrasil/nextjs/node_modules/next/dist/server/require.js:112:75)
at /home/webdev/nftreesbrasil/nextjs/node_modules/next/dist/server/load-components.js:80:84
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async loadComponentsImpl (/home/webdev/nftreesbrasil/nextjs/node_modules/next/dist/server/load-components.js:80:26)
at async DevServer.findPageComponentsImpl (/home/webdev/nftreesbrasil/nextjs/node_modules/next/dist/server/next-server.js:434:36) {
digest: undefined
}
The text was updated successfully, but these errors were encountered: