Pawieplays
Pawieplays
NNuxt
Created by Pawieplays on 10/7/2024 in #❓・help
SSR useAsyncData still calling the API in client side?
I see. Thanks for confirming. We thought we could do the same behaviour as we did with Nuxt 2.
13 replies
NNuxt
Created by Pawieplays on 10/7/2024 in #❓・help
SSR useAsyncData still calling the API in client side?
Thanks for confirming, Alex. Although, can we hide that client-side navigation API call?
13 replies
NNuxt
Created by Pawieplays on 10/7/2024 in #❓・help
SSR useAsyncData still calling the API in client side?
Yep I understand that, but this is SSR, and not static pages. Our data is pretty dynamic and changes a lot in the CMS side. Before we could do this on Nuxt 2, just using asyncData. It will call the APIs in the server side (without calling it in the client side) before serving the page. Is this still possible in Nuxt 3?
13 replies
NNuxt
Created by Pawieplays on 10/7/2024 in #❓・help
SSR useAsyncData still calling the API in client side?
Hello Alex! I always watch your video. Thank you for responding. Actually yes you are correct. Its an incorrect description. The API call won't happen again if you visit the page but, when I navigate to another page (first visit), and check the network tab, you could see the API call from our proxied CMS being shown in the dev tools. I guess our goal is to prevent this and for Nuxt to render the page on server side without calling the API in the client side? Is this possible?
13 replies
NNuxt
Created by Pawieplays on 10/7/2024 in #❓・help
SSR useAsyncData still calling the API in client side?
Here is our code sample <script setup lang="ts"> import { metaDesc } from '~/utils/seo' const nuxtApp = useNuxtApp() const { data: pageData } = await useAsyncData('homepage', () => useCmsPageQuery('/'), { getCachedData(key) { return nuxtApp.payload.data[key] || nuxtApp.static.data[key] } }) useHead(metaDesc(pageData?.value?.data?.seo)) </script>
13 replies
NNuxt
Created by Pawieplays on 10/1/2024 in #❓・help
useAsyncData dual call issue. One in the client side and server side?
not sure on we can fix thi. On nuxt 2 I remember the asyncData will do server side rendering, but on nuxt 3 its calling the API in the client side and server side
4 replies
NNuxt
Created by Pawieplays on 10/1/2024 in #❓・help
useAsyncData dual call issue. One in the client side and server side?
Here is my home page: <script setup lang="ts"> import { metaDesc } from '~/utils/seo' const nuxtApp = useNuxtApp() const { data: pageData } = await useAsyncData('homepage', () => useCmsPageQuery('/'), { getCachedData(key) { return nuxtApp.payload.data[key] || nuxtApp.static.data[key] } }) useHead(metaDesc(pageData?.value?.data?.seo)) </script>
4 replies
NNuxt
Created by Pawieplays on 3/12/2024 in #❓・help
fetch failed
Im not sure if nuxt already "built" these endpoints on server when the plugin is called
6 replies
NNuxt
Created by Pawieplays on 3/12/2024 in #❓・help
fetch failed
Yep im using nuxt auth, but I tried to implement it first on my own and same issue. Basically what im doing is like nuxtServerInit and then inside the scope, refresh the token and get the user session. But doesnt seem to work.
6 replies
NNuxt
Created by Pawieplays on 3/12/2024 in #❓・help
fetch failed
Hello, basically Im trying to refresh my token on page reload and also getting the user session. I have api/auth/refresh endpoint but when its called on server its giving this error.
6 replies