Repository navigation
Closed
Labels
Description
[REQUIRED] Environment info
firebase-tools: 13.34.0
Platform: Windows
[REQUIRED] Test case
Upload file bigger then 100k
[REQUIRED] Steps to reproduce
Reproduceable in Emulator only
Upload file bigger then 100k, using uploadBytes function in Frontend
The issue is in Express default limit configuration :
[REQUIRED] Expected behavior
File is uploaded
[REQUIRED] Actual behavior
Error
PayloadTooLargeError: request entity too large
at readStream (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\raw-body\index.js:163:17)
at getRawBody (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\raw-body\index.js:116:12)
at read (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\body-parser\lib\read.js:79:3)
at rawParser (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\body-parser\lib\types\raw.js:81:5)
at Layer.handle [as handle_request] (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\layer.js:95:5)
at trim_prefix (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\index.js:328:13)
at ~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\index.js:286:9
at Function.process_params (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\index.js:346:12)
at next (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\express\lib\router\index.js:280:10)
at rawParser (~\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\body-parser\lib\types\raw.js:76:7)
Activity
aalej commentedon Mar 18, 2025
Hey @alexcibotari, thanks for reaching out. I'm trying to reproduce this, but so far I haven't encountered the same error when using
uploadBytes. Also, I think the limit for the upload size in the Storage emulator is 130mb, which is being set infirebase-tools/src/emulator/storage/server.ts
Lines 61 to 62 in 61afeba
Could you give this repo a try? It's a web app that uploads an image(~4mb in size) to the Storage emulator. Let me know in case I may have missed anything here. By any chance, could you share a minimal reproducible example? This will help us accurately reproduce the issue
joehan commentedon Mar 18, 2025
Looks like this might be coming from ExpressBasedEmulator.ts (and only would affect uploads from the emulator UI). I'll take a crack at addressing this.