Skip to content

date: 2026-06-11 tags: [inertia, vue, forms, pest-browser, multipart] status: active graduated_to: .claude/rules/inertia.md

Don't force multipart on a text-only Inertia useForm submit

Symptom — four per-task chat-send browser tests failed with The message field is required — the typed message never reached the server, even though canSend (which gates the post on a non-empty message) had to be true for the request to fire at all.

Root causemessages.post(url, { forceFormData: true }) forced multipart on every send, even with no file attached. Inertia already switches to FormData automatically when the payload contains a File, so forcing it is both needless and the trigger: pest-browser's in-process amphp server didn't surface the plain-text message field out of that multipart body. The JSON-posting feature tests passed, so the gap only showed at the browser layer (exactly why the epic's browser tests exist).

FixforceFormData: messages.images.length > 0 — only multipart when a file is actually attached (resources/js/pages/tasks/Show.vue, commit d2ac643).

Guard — the chat-send browser tests (tests/Browser/TaskChatTest.php et al.) + the .claude/rules/inertia.md line ("force forceFormData only when a file is attached").