Skip to content

Cloudflare Turnstile Not Loading VueJS Custom Element – undefined (reading ‘toLowerCase’)

I decided to try Cloudflares take on the “Captcha” problem with Turnstile. It’s a pretty useful tool albeit I had one problem, I couldn’t actually get it to initialze.

Turns out as this Cloudflare forum poster made me aware of, it’s because my component never had a body, nor was included in a <body> tag. Seemingly the documentation is missing this, presuming I guess everyone’s forms are in bodys I suppose.

Add a Body, you’ll be golden.

IE:

Before: 
<div>
<cf-element>
</div>

Now:
<body>
<div>
<cf-element>
</div>
</body>