nuxt-modules / turnstile

🔥 Cloudflare Turnstile integration for Nuxt

Home Page:https://cloudflare.com/products/turnstile

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

initialization errors in nuxt 3.0.0 dev mode

PawelDmochowski opened this issue · comments

🐛 The bug

Receiving this error when running in dev mode in a minimal setup (see reproduction - everything is copied directly from provided playground).

image

The result is dev server not starting.

🛠️ To reproduce

https://github.com/PawelDmochowski/nuxt-turnstile-dev-error.git

🌈 Expected behaviour

Dev server should start.

ℹ️ Additional context

Simple commenting out the line with verifyTurnstileToken makes the server start.
image

Also if I copy contents of src/runtime/nitro/utils/verify.ts directly into api endpoint in server/api/submit.ts everything works fine.
image

Looks like the same underlying issue as nuxt-modules/html-validator#232 - you can try using WSL as a workaround until this is resolved.

Thanks for looking into it. It certainly looks like the same nuxt/nuxt#15249 related issue.
BTW: production build is not throwing any errors and the resulting code works correctly so it's only a dev issue.

Would you try with the edge channel to see if this is resolved? https://nuxt.com/docs/guide/going-further/edge-channel/

Edge channel does not fix the issue.

Would you mind trying again with the latest version of this module, @PawelDmochowski? 🙏

Any combination newer than Nuxt 3.1.0 and module version 0.1.2 seems to be working correctly. 👍

Great! If the issue reappears, this can be reopened! :)