Eomm / fastify-raw-body

Request raw body
MIT License
44 stars 10 forks source link

TypeError: Cannot read properties of undefined (reading ‘bodyLimit’) #40

Closed GDdark closed 1 year ago

GDdark commented 1 year ago

Exception: {“stack”:“TypeError: Cannot read properties of undefined (reading ‘bodyLimit’)\n at Object.preparsingRawBody (/data/code/node-server/node_modules/fastify-raw-body/plugin.js:59:45)\n at next (/data/code/node-server/node_modules/fastify/lib/route.js:546:16)\n at preParsingHookRunner (/data/code/node-server/node_modules/fastify/lib/route.js:569:3)\n at runPreParsing (/data/code/node-server/node_modules/fastify/lib/route.js:520:5)\n at next (/data/code/node-server/node_modules/fastify/lib/hooks.js:168:7)\n at /data/code/node-server/node_modules/@fastify/cors/index.js:130:12\n at resolveOriginOption (/data/code/node-server/node_modules/@fastify/cors/index.js:88:129)\n at onRequest (/data/code/node-server/node_modules/@fastify/cors/index.js:90:3)\n at Object.onRequestCors (/data/code/node-server/node_modules/@fastify/cors/index.js:32:7)\n at hookIterator (/data/code/node-server/node_modules/fastify/lib/hooks.js:246:10)\n at next (/data/code/node-server/node_modules/fastify/lib/hooks.js:174:16)\n at Object.runMiddie (/data/code/node-server/node_modules/@fastify/middie/index.js:44:7)\n at hookIterator (/data/code/node-server/node_modules/fastify/lib/hooks.js:246:10)\n at next (/data/code/node-server/node_modules/fastify/lib/hooks.js:174:16)\n at hookRunner (/data/code/node-server/node_modules/fastify/lib/hooks.js:196:3)\n at Object.routeHandler as handler”,“message”:“Cannot read properties of undefined (reading ‘bodyLimit’)”}

Eomm commented 1 year ago

Could you add a Minimal, Reproducible Example?

Without it, we are unable to help you.

Eomm commented 1 year ago

PS: I suspect you have a fastify version less than 4.10 installed

Could you check che fix work for you?