question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

empty req.body and req.file when run in firebase hosting

See original GitHub issue

I don’t know if its the problem of firebase or multer .


app.post('/' ,  multer({ dest: "data/" , limits : { fileSize : 5242880 } }).single('image_file'),  (req , res)=>{

    console.log("req.body : " , req.body) ;
    console.log("req.file  : " , req.file) ; 

It works fine on my local server but when I deploy it to firebase , it gives me empty req.body and req.file . How to fix this ?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:6
  • Comments:5

github_iconTop GitHub Comments

7reactions
nateshmbhatcommented, Jun 10, 2018

I found out that a firebase update made this multer module unworkable . So we can’t use multer with firebase hosting now .

Read this Handling multipart data

0reactions
nickjuntillacommented, Nov 3, 2018

Thanks for pointing out the firebase bug! I ended up using busboy. It was the only way that worked for me. 2 days on this so far!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase Multer's req.body and req.file are Empty in Multiform ...
When ever i submit multi part form from client , it gives me empty req.body and req.file . I am using multer to...
Read more >
Manage functions | Cloud Functions for Firebase - Google
To deploy functions, run this Firebase CLI command: ... The engines field is required; it must specify one of the supported Node.js versions...
Read more >
Upload file data | Google Drive
Send the initial request · If you have metadata for the file, add the metadata to the request body in JSON format. Otherwise,...
Read more >
HTTP request body | Cloud Functions Documentation
using TextReader reader = new StreamReader(request.Body); string json = await reader.ReadToEndAsync(); JsonElement body = JsonSerializer.
Read more >
Trying to send form data but i'm getting req.body as undefined
Click send and you should get a response with a status code of 200. If you get an error like me telling me...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found