You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When submitting a form with enctype="multipart/form-data" and an empty file input, the result of getting the value inside a Vercel edge function is an empty string.
Bug Report
When submitting a form with
enctype="multipart/form-data"
and an empty file input, the result of getting the value inside a Vercel edge function is an empty string.If we do the same thing in a serverless function, we get a
File
object with a size of 0 instead, which is the expected behavior.This messed up server-side form validation in one of my production site and was very hard to debug.
Additional context/screenshots
The test the issue, I ran the following code (using a Sveltekit server action) in both an edge function and a serverless function:
Here are the logs from the Vercel dashboard.
Edge function log:
Serverless function log:
The text was updated successfully, but these errors were encountered: