Last active
January 21, 2025 12:10
-
-
Save Maqsim/857a14a4909607be13d6810540d1b04f to your computer and use it in GitHub Desktop.
HOW TO FIX "413 Payload too large" in NodeJS (Express)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
... | |
// Express 4.0 | |
app.use(bodyParser.json({ limit: '10mb' })); | |
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' })); | |
// Express 3.0 | |
app.use(express.json({ limit: '10mb' })); | |
app.use(express.urlencoded({ limit: '10mb' })); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🔴 This was all bun runtime's fault from now on
Well, nothing works for me.
I always got 413 response.
I'm using BUN as runtime, express v4.21.2 and body-parser v1.20.3
Try 1
Try 2
Try 3
Try 4
Try 5
It's just don't want to work. It works on localhost but not on server.
The proxy maintainer said that it is my app's fault.