Pawieplays
SSR useAsyncData still calling the API in client side?
Here is our scenario, when I initially load the page, the API call is made via server side only, no API call from the CMS visible. After navigating to another page (without exiting the site) and then returning to the original page, the developer tools show that the API call is triggered again on the client side. Is there a way to prevent this?
We tried getCachedData but still the same behaviour. We just want to block the navigation I guess. This was possible in Nuxt2.
13 replies
useAsyncData dual call issue. One in the client side and server side?
Hi everyone,
We're trying to implement SSR in Nuxt 3 without making API calls on the client side. This worked fine in Nuxt 2, but in Nuxt 3, when navigating to a page, the useAsyncData function still triggers an API call. Is there a way to prevent this and enforce blocking navigation like we had in Nuxt 2? Any advice would be appreciated!
4 replies
Metadata for Route
How to pass a metadata from the next route? On Nuxt 2, I remember you can pass additional parameters but it seems like this has been removed on Nuxt 3?
I'm aware you can use the query parameters but the payload to the next route is quite long and we don't want to put that in the URL.
3 replies
fetch failed
Can someone help me please? I dont understand why I cant call the auth refresh on server side, i kept getting this error
500
[POST] "https://localhost:8080/api/auth/refresh": <no response> fetch failed
at async $fetch2 (/D:/Projects/advance@nuxt3/node_modules/ofetch/dist/shared/ofetch.00501375.mjs:261:15)
at async setup (D:\Projects\advance@nuxt3\node_modules@sidebase\nuxt-auth\dist\runtime\plugins\refresh-token.server.mjs:30:19)
at async setup (D:\Projects\advance@nuxt3\virtual:nuxt:D:\Projects\[email protected]\plugins\server.mjs:44:116)
at async Object.callAsync (/D:/Projects/advance@nuxt3/node_modules/unctx/dist/index.mjs:72:16)
at async applyPlugin (D:\Projects\advance@nuxt3\node_modules\nuxt\dist\app\nuxt.js:116:25)
at async executePlugin (D:\Projects\advance@nuxt3\node_modules\nuxt\dist\app\nuxt.js:153:9)
at async Module.applyPlugins (D:\Projects\advance@nuxt3\node_modules\nuxt\dist\app\nuxt.js:161:5)
at async createNuxtAppServer (D:\Projects\advance@nuxt3\node_modules\nuxt\dist\app\entry.js:26:7)
at async default (/D:/Projects/advance@nuxt3/node_modules/@nuxt/vite-builder/dist/runtime/vite-node.mjs:33:18)
6 replies