8

When trying to deploy my Typescript Next.js application to Vercel, the build fails despite working fine, and building fine locally.

No clue where the error is, or how to fix.

My application has an input field on the frontend, which sends the input to the NextJS API that connects to MongoDB and saves the inputs

Full error:

TypeError: Cannot set property Request of # which has only a getter at /vercel/path0/node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js:529:18 at /vercel/path0/node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js:542:5 at /vercel/path0/node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js:3:3 at Object. (/vercel/path0/node_modules/abortcontroller-polyfill/dist/polyfill-patch-fetch.js:4:3) at Module._compile (node:internal/modules/cjs/loader:1105:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18)

Pajke
  • 347
  • 1
  • 3
  • 12

1 Answers1

12

Solved it.

For anyone running into this error in the future, IF you are importing the Web3 package, the solution was to downgrade the Web3 package to an earlier version.

For me, the solution was:

npm install web3@1.7.4

web3 lib's github issue: here

Klesun
  • 12,280
  • 5
  • 59
  • 52
Pajke
  • 347
  • 1
  • 3
  • 12