BT1010
call composable from setup globally from nuxt3 layer
In my nuxt3 layer I have my own composable which is using useReCaptcha composable. (https://github.com/AurityLab/vue-recaptcha-v3) This composable must be executed from the setup therefore my own composable also needs to be executed from
setup
. However as this is something I always want to run when app starts on the client, I currently have it inside app.vue within the layer like this:
But this is app.vue inside a layer. I don't want to have app.vue in the layer. I want to have app.vue in the app where I use this layer. Where elsewhere I can call useCaptcha
? I want to keep execution of this composable within the layer2 replies
useFetch & URLSearchParams nuxt3 global middlewere
Guys i'm trying out
useFetch
inside my global middlewere (ts file) I basically want to sent http request from the server side and use URLSearchParams
as my API requires it
with this code I'm getting following error:
Error: Unknown object type "urlsearchparams" at Object._object (index.mjs?v=b79dfc53:57:17) at Object.dispatch (index.mjs?v=b79dfc53:34:30) at Object._array (index.mjs?v=b79dfc53:88:16) at Object._object (index.mjs?v=b79dfc53:53:30) at Object.dispatch (index.mjs?v=b79dfc53:34:30) at objectHash (index.mjs?v=b79dfc53:13:10) at hash (index.mjs?v=b79dfc53:481:56) at useFetch (fetch.mjs?v=b79dfc53:6:28) at default (auth.server.global.ts:23:7) at fn (nuxt.mjs?v=b79dfc53:141:27)URLSearchParams should be available in Node so what's going on?
3 replies