Closed Applelo closed 1 day ago
I have change this
nuxt.options.runtimeConfig = defu(nuxt.options.runtimeConfig, {
turnstile: {
secretKey: options.secretKey,
},
public: {
turnstile: {
siteKey,
},
},
})
to this
nuxt.options.runtimeConfig.turnstile = defu(nuxt.options.runtimeConfig.turnstile, {
secretKey: options.secretKey,
});
nuxt.options.runtimeConfig.public.turnstile = defu(nuxt.options.runtimeConfig.public.turnstile, {
siteKey,
});
I will make a PR to fix this issue.
Here a patch file waiting for the fix to be release on the next version of nuxt.
I believe this issue should be resolved in https://github.com/nuxt/nuxt/pull/27596. Would you check with the nightly release channel? đ
Yeah it solves the issue. Thanks, I close the PR and I will close this issue when the next version is release with the fix đ
Great! It should be out this weekend đ¤
Is out and I can confirm this resolves the issue. @Applelo I hope you can agree? :raised_hands:
Yeah it is working as expected đ Thanks for your reactivity đ
Not at all - and sorry for the pain đ
đ The bug
Since Nuxt 3.12, Nuxt Turnstile is causing bugs across my website with two modules. The first one, nuxt-multi-cache was easy to fix, I had just to change the position of the modules inside the nuxt.config.ts file. The second one, @nuxtjs/sitemap throws an error when I load the website.
If I remove the Nuxt Turnstile module, Nuxt sitemap is working as expected.
đ ī¸ To reproduce
https://stackblitz.com/edit/nuxt-starter-dj2rf9?file=nuxt.config.ts
đ Expected behaviour
To not making other modules crash :)
âšī¸ Additional context
Build Modules: -
[EDIT] After investigation, nuxt-site-config-inject this kind of payload
And nuxt turnstile rewrite it somehow and remove all information on
nuxt-site-config
object.[EDIT 2] Seems like the following lines are causing the issue by overwriting stack. https://github.com/nuxt-modules/turnstile/blob/2b425eec7c99ff4cd04021cc3dff8dbd499f44a9/src/module.ts#L67C4-L76C7
[HS EDIT] Another issue I found, we need to put on runtimeConfig the .env infos. It was not necessary before Nuxt 3.12. Related to #27117 ?