-
-
Notifications
You must be signed in to change notification settings - Fork 23
Description
🆒 Your use case
When I build the project, I don't know beforehand if it's going to have active Turnstile integration or not. I run it in multiple environments; in production and pre-prod I provide the runtime key (which is different between the two), and in staging and e2e testing environments I don't. The respective front-end code checks for the presence of the key and doesn't inject the <nuxt-turnstile> component unless the key is present.
Currently, the module always prints a warning on build:
WARN No site key was provided. Make sure you pass one at runtime by setting NUXT_PUBLIC_TURNSTILE_SITE_KEY.
I don't like that warning. My project is supposed to work perfectly fine without the runtime key, it's not correct and misleading that it demands to "make sure" to pass one. I would like to have a way to silence the warning.
🆕 The solution you'd like
I see two solutions.
-
Emit the warning at runtime (not at build time), when
<nuxt-turnstile>component is instantiated without the key. -
Add
nuxtConfig.turnstile.silenceBuildWarningor something along the lines.
🔍 Alternatives you've considered
No response
ℹ️ Additional info
No response