Server fails due to watch is not defined error in script.ts
acidbiscuit opened this issue Β· comments
π The bug
Nuxt.js server throws an error on the first visit in the browser due to missing watch
import in script.mjs
:
[nuxt] [request error] [unhandled] [500] watch is not defined 03:13:35
at ./node_modules/nuxt-turnstile/dist/runtime/plugins/script.mjs:71:27
at fn (./node_modules/nuxt/dist/app/nuxt.mjs:151:27)
at Object.callAsync (./node_modules/unctx/dist/index.mjs:49:19)
at callWithNuxt (./node_modules/nuxt/dist/app/nuxt.mjs:153:23)
at applyPlugin (./node_modules/nuxt/dist/app/nuxt.mjs:97:29)
at Module.applyPlugins (./node_modules/nuxt/dist/app/nuxt.mjs:107:11)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async createNuxtAppServer (./node_modules/nuxt/dist/app/entry.mjs:29:7)
at async default (./node_modules/@nuxt/vite-builder/dist/runtime/vite-node.mjs:27:18)
at async Object.renderToString (./node_modules/vue-bundle-renderer/dist/runtime.mjs:172:19)
Related to changes in #80.
Can be reproduced in the playground with the latest version.
π οΈ To reproduce
https://stackblitz.com/github/danielroe/nuxt-turnstile/tree/main/playground?file=package.json
π Expected behaviour
No errors are thrown with nuxt-turnstile
module.
βΉοΈ Additional context
No response