Server Action 405 Method Not Allowed
Answered
Tomistoma posted this in #help-forum
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.
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.
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.
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.
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
@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.
You can up that file size limit ;))
If its self hosted and all that jazz
TomistomaOP
That means it wouldn't be on vercel right