Captcha not working

I’m creating a contact form using the documentation.
However, the captcha isn’t working (not showing).

The console outputs this error:

Error: Missing required parameters in RecaptchaOptions: sitekey

However, my recaptcha_site_key is defined.
Without the captcha, the form works perfectly fine.

Here’s the full (edited) contact page’s frontmatter:

title: 'Nous contacter’
visible: true
in_nav: true
coord: "Company address"
action: /contact
name: contact
name: name
label: 'Votre nom complet’
placeholder: 'Nom complet’
type: text
autofocus: 'on’
required: true
name: company
label: 'Votre société’
placeholder: Société
type: text
name: email
label: 'Votre adresse e-mail’
placeholder: E-mail
type: email
rule: email
required: true
name: phone
label: 'Votre numéro de téléphone’
placeholder: Téléphone
type: text
name: message
label: 'Votre message’
placeholder: Message
type: textarea
required: true
name: g-recaptcha-response
label: Validation
type: captcha
recaptcha_site_key: I-WROTE-THE-KEY-HERE
recaptcha_not_validated: 'Validation incorrecte.'
required: true
type: submit
value: Envoyer
recaptcha_secret: I-WROTE-THE-OTHER-KEY-HERE
from: '{{ }}'
from_name: '{{|e }}'
to: '{{ }}'
subject: '[Site] Message de {{|e }},{% if %} ({{|e }}){% endif %}'
body: ‘{% include ‘‘forms/data.html.twig’’ %}’
fileprefix: contact-
dateformat: Ymd-His-u
extension: txt
body: ‘{% include ‘‘forms/data.txt.twig’’ %}’
message: hop!
display: ok

Can someone see what’s wrong?

Where are you setting the recpatcha_site_key? Can you paste your YAML where this is set between --- marks so it displays it as code with proper indents etc. It’s basically impossible to tell if you have an error when you paste your YAML as regular text as all the indents are lost, and they are crucial in YAML.

Actually the current version of the Form plugin has the recaptcha_site_key and recaptcha_secret with a typo.

Use recatpcha_site_key and recatpcha_secret (notice pt inverter) - I know this is a hassle, the next version will fix this (and still allow values with the typo, to avoid breaking existing working integrations)

@flaviocope: Thanks a lot! I lost so much time trying to find what was wrong, I would never have found this. It’s now working!

@rhukster: Thanks for the tip about ---, I didn’t see the indents has been removed in my message.