Closed caiodigioia closed 6 months ago
The problem is apparently you're trying to use busboy three different times (via connect-busboy
, busboy-body-parser
, and then explicitly in your route handler). Once anything (busboy or otherwise) has consumed the entire request body, nothing else can consume it because there is no more data. That is why you're seeing the error.
Thanks so much, @mscdex ! I solved the error.
Hey guys! Why am I getting this error? I found this code in a YouTube tutorial (https://www.youtube.com/watch?v=04QoJx7r_XQ&lc=UgzNYMVDuSx_ip2J56l4AaABAg), published 2 years ago. I think something may have changed. Can someone help me please? Error: Unexpected end of form at Multipart._final (/Users/caiodigioia/curso-react-native/Salao/node_modules/busboy/lib/types/multipart.js:588:17) at callFinal (node:internal/streams/writable:698:12) at prefinish (node:internal/streams/writable:710:7) at finishMaybe (node:internal/streams/writable:720:5) at Writable.end (node:internal/streams/writable:634:5) at IncomingMessage.onend (node:internal/streams/readable:705:10) at Object.onceWrapper (node:events:628:28) at IncomingMessage.emit (node:events:514:28) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Here is my code:
Servico.routes.js: (I've noticed that the console.log('Try') does not appear in the console, so I guess there is a problem to make the try, but I don't know what is the problem)
index.js:
Node Version: v18.17.0 To post to API, I'm using Insomnia, with Multpart option "dependencies": { "@aws-sdk/client-s3": "^3.521.0", "aws-sdk": "^2.1566.0", "busboy": "^1.6.0", "busboy-body-parser": "^0.3.2", "connect-busboy": "^1.0.0", "cors": "^2.8.5", "express-busboy": "^10.1.0", "formidable": "^3.5.1", "mongoose": "^8.2.0", "multer": "^1.4.5-lts.1", "multer-s3": "^3.0.1" }