formspree / formspree-js

The fastest way to hook up a React form
https://formspree.io/javascript
MIT License
63 stars 12 forks source link

Form not submitting, getting 404 #4

Closed esausilva closed 4 years ago

esausilva commented 4 years ago

I am creating a form with Formspree CLI and following all the steps. However, when submitting the form I get 404.

This is my formspree.json. The form deploys just fine with this configuration.

{
  "forms": {
    "lets-chat": {
      "name": "Let's Chat",
      "fields": {
        "name": { 
          "type": "text",
          "prettyName": "Name",
          "required": true 
        },
        "email": { 
          "type": "email", 
          "prettyName": "Email address",
          "required": true 
        },
        "message": { 
          "type": "text", 
          "prettyName": "Message",
          "required": true 
        }
      },
      "actions": [
        {
          "type": "email",
          "to": "an...n@outlook.com"
        }
      ],
      "allowExtraFields": false
    }
  }
}

Then this is my React code

const LetsChat = () => {
  const [formState, handleSubmit] = useForm('lets-chat');

  return (
    <FormspreeProvider project={process.env.GATSBY_FORMSPREE_PROJECT_ID}>
      <LetsChatSection>
        <h2>What can I create for you?</h2>
        <Form method="POST" onSubmit={handleSubmit}>
          ...
        </Form>
      </LetsChatSection>
    </FormspreeProvider>
  );
};

Then when I submit the form this is the request URL in the headers

Request URL: https://formspree.io/f/lets-chat
Request Method: POST
Status Code: 404 

And this is the response

{
  "error": "Form not found",
  "errors": [
    {
      "code": "FORM_NOT_FOUND",
      "message": "Form not found, please check the form hashid"
    }
  ]
}
colevscode commented 4 years ago

Hi please use our customer support request form at https://help.formspree.io/hc/en-us/requests/new. We can't provide support over github issues at this time. Sorry!