-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
bugSomething isn't workingSomething isn't workingfeat:fetchIssues related to @remix-run/web-fetchIssues related to @remix-run/web-fetchfeat:forms
Description
What version of Remix are you using?
1.6.1
Steps to Reproduce
Empty remix app with this route
import { ActionFunction } from '@remix-run/node';
import { useSubmit } from '@remix-run/react';
import { useRef } from 'react';
export let action: ActionFunction = async ({ request }) => {
const fdata = await request.formData();
console.log(fdata);
return null;
};
const Comp = () => {
const submit = useSubmit();
const formRef = useRef<any>();
return (
<>
<form ref={formRef}>
<input type="file" name="test" />
</form>
<button
onClick={() => {
submit(formRef.current, {
method: 'post',
encType: 'multipart/form-data',
});
}}>
CLICK SEND WITHOUT FILE. BOOM!
</button>
</>
);
};
export default Comp;Clic the button without any file.
Got this error on the server:
TypeError: filename is only supported when value is Blob or File
Expected Behavior
Simply work.
Actual Behavior
Gives error.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfeat:fetchIssues related to @remix-run/web-fetchIssues related to @remix-run/web-fetchfeat:forms