Open hdodov opened 1 week ago
@denolfe @jmikrut hey, guys, this error surprised us badly in the last moment. While it gets fixed, is there any quick and dirty workaround you could recommend?
I believe it's tied to body-parser. As explained here, I tried adding this:
app.use(express.urlencoded({limit: '50mb'}));
…and even tried hacking the internal packages/payload/src/express/middleware/index.ts
file by adding limit: '50mb'
there too, but it didn't work.
Sorry for the lack of reproduction repo, but we're in a bit of a hurry and have a deadline tomorrow. Do you have any quick ideas off the top of your head?
In case anyone else bumps into this, there's the express.json.limit
option in payload.config.ts to increase the limit:
export default buildConfig({
express: {
json: {
limit: 512000,
},
},
});
But I'm going to leave this issue open because the Payload types and docs say that the limit is 2MB
(which wouldn't have been a problem for me if it were true), when in reality it's 102400
bytes (I saw it in the debugger). The express docs that Payload links to from its docs also say that the default limit is "100kb"
:
Link to reproduction
N/A
Describe the Bug
We have a collection with a rich text field and versions and autosave enabled. When you have a lot of text, the changes can't be saved. You get the following error:
In the browser, this request fails https://example.com/api/my-collection/6674404ef834dbb0e77a7e07?draft=true&autosave=true&locale=en with status code 413.
To Reproduce
Payload Version
2.16.0
Adapters and Plugins
No response