Skip to content

Bug: Contact form submission fails because of invalid FormData conversion #12

Description

@RishiGoswami-code

Bug: Contact form submission fails because of invalid FormData conversion

Summary

The marketing contact forms fail at submit time because the code attempts to call toArray() on FormData.entries(). This is not a valid browser API and causes the submit handler to throw before analytics or feedback hooks can run.

Affected files

Steps to reproduce

  1. Open any of the marketing forms.
  2. Fill in the required fields.
  3. Submit the form.
  4. The page throws an error during submit handling.

Expected behavior

The form should submit successfully and send the captured data to PostHog and Sentry without crashing.

Actual behavior

The submit handler throws because formData.entries().toArray() is invalid. The form never completes submission and user conversion flow breaks.

Root cause

FormData.entries() returns an iterator, not an array. Calling .toArray() is invalid in the browser runtime.

Fix implemented

The code was updated to use a valid conversion approach:

  • Array.from(formData.entries())

This preserves the form values correctly and allows Object.fromEntries(...) to work as expected.

Impact

  • Contact form submissions can fail
  • Lead capture flow breaks
  • Analytics and feedback tracking may not fire

Verification

The fix was applied in the form handlers and the invalid method call was removed from the affected files.

Acceptance criteria

  • Form submission completes without throwing an error
  • Captured field values are correctly converted into an object
  • PostHog and Sentry tracking still run as expected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions