Closed hdwebpros closed 2 months ago
Hey Ryan, thank your for this report! Would you try the following stackblitz link to create a minimal reproduction?
👉 https://stackblitz.com/github/nuxt-modules/turnstile/tree/stackblitz/playground
Please replace "@nuxtjs/turnstile": "link:..",
with "@nuxtjs/turnstile": "latest",
in the current stackblitz project.
I've opened #331 to address the issue of the incorrect link.
I just noticed that this issue was created some time ago and by now this module had a major rewrite. Please check if the current version works for you and if it doesn't we can reopen :)
🐛 The bug
According to https://github.com/nuxt-modules/turnstile/blob/main/README.md this is all you need in your Nuxt config to declare the siteKey
However, that provides an error
NuxtTurnstile.vue:53 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'siteKey')
I couldn't use your Stackblitz since that gives:
🛠️ To reproduce
Doesn't work. All I have on my Nuxt app for modules though is Tailwind and Turnstile. I just followed the docs as they say.
🌈 Expected behaviour
I expected not to get the error.
ℹ️ Additional context
In order to fix my issue, I put the suggested code into public runtimeConfig and it worked. My final implementation was: