Next.js Discord

Discord Forum

Server Action 405 Method Not Allowed

Answered
Tomistoma posted this in #help-forum
Open in Discord
TomistomaOP
Getting a 405 Method not allowed in my server action, which is triggered when a user selects a file to upload. Works fine in local development, but returns 405 in production.

I included the two relevant files.
Answered by Tomistoma
Solution:

Next.js in production doesn't allow a server response greater than 4.5 MB and my response is 17 MB. This is what was causing the 405 error. The server logs had the more complete error message. Once I tried it with a smaller file size, it worked.
View full answer

5 Replies

TomistomaOP
TomistomaOP
Solution:

Next.js in production doesn't allow a server response greater than 4.5 MB and my response is 17 MB. This is what was causing the 405 error. The server logs had the more complete error message. Once I tried it with a smaller file size, it worked.
Answer
TomistomaOP
That means it wouldn't be on vercel right