nuxt-modules/turnstile

Turnstile Widget seem to have crashed: 30se3

Opened this issue ยท 3 comments

๐Ÿ› The bug

My issue is pretty close to the mentioned one.
I upgraded to beta to test the changes. But they don't solve the current issue.

VM25358 api.js:1 Uncaught TurnstileError: [Cloudflare Turnstile] Error: 300030.
    at g (VM25358 api.js:1:10466)
    at Object.C [as msgHandler] (VM25358 api.js:1:35952)
    at Ur (VM25358 api.js:1:17956)
    at VM25358 api.js:1:18354

This error appears when I have 2 pages with forms where I have the turnstile widget. And when I change route, I have the error every ~2 sec.
I tried to play with v-if and watch implemented language changes with the i18n module but it didn't help me

<NuxtTurnstile
    v-if="isVisible"
    ref="widget"
    v-model="token"
    :options="{
        action: 'vue',
        language,
        size: 'flexible',
    }"
/>
const { locale } = useI18n()

const token = defineModel<string>({
    type: String,
    default: '',
})

const widget = ref()

const isVisible = shallowRef<boolean>(false)

const language = computed<string>(() => {
    const localeValue = toValue(locale)

    return localeValue === 'ua' ? 'uk' : localeValue
})

watch(
    () => locale,
    () => {
        widget.value?.reset()
        isVisible.value = true
    },
    {
        flush: 'post',
    })

onMounted(() => {
    isVisible.value = true
})

onUnmounted(() => {
    isVisible.value = false
})

๐Ÿ› ๏ธ To reproduce

โ€”

๐ŸŒˆ Expected behaviour

The mentioned error is gone

โ„น๏ธ Additional context

I wrapped the component with a custom one to simplify reusing. I tried to add .client to the name or wrap in ClientOnly / KeepAlive but it didn't help me as well

Image

Again this issue occurs, from the latest version tested.

I can confirm this is a bug. Encountering the same issue, having i18n and two widgets on a page. Anyone have a solution to this?

Chippd commented

I'm seeing this too, but as far as I can tell it doesn't stop the user from proceeding unless I'm missing something. Annoying as it clogs up the console and Sentry though