Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: documented way of using siteKey doesn't work #318

Closed
hdwebpros opened this issue Jun 25, 2024 · 2 comments
Closed

fix: documented way of using siteKey doesn't work #318

hdwebpros opened this issue Jun 25, 2024 · 2 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation needs reproduction

Comments

@hdwebpros
Copy link

🐛 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

  turnstile: {
    siteKey: '<your-site-key>',
  },

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:

# This is a non-commercial version of StackBlitz.
# If you’re using this for business purposes, please purchase a license here.

~/projects/gqairkmjlx.github
❯ npm install && npm run dev
npm ERR! code EUNSUPPORTEDPROTOCOL
npm ERR! Unsupported URL Type "link:": link:..

npm ERR! A complete log of this run can be found in: /home/.npm/_logs/2024-06-25T13_56_37_750Z-debug-0.log

🛠️ 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:

  runtimeConfig: {
    public: {
      turnstile: {
        siteKey: "<my-site-key>",
      },
    },
    turnstile: {
      secretKey: "<my-secret-key>",
    },
  },
@hdwebpros hdwebpros added the bug Something isn't working label Jun 25, 2024
@maige-app maige-app bot added the documentation Improvements or additions to documentation label Jun 25, 2024
@dargmuesli
Copy link
Collaborator

dargmuesli commented Sep 13, 2024

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.

@dargmuesli dargmuesli changed the title Documentation way of using siteKey doesn't work fix: documented way of using siteKey doesn't work Sep 17, 2024
@dargmuesli
Copy link
Collaborator

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 :)

@dargmuesli dargmuesli closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation needs reproduction
Projects
None yet
Development

No branches or pull requests

2 participants