useLazyFetch initial load not pending
I have a question about showing a loading state. In a simple example, I am trying to use the
pending
state from useLazyFetch
on initial page load. Pending only appears to get set when I use the refresh
method. Why does useLazyFetch appear to block on initial server page load? I have tried using await and not await, they don't seem to matter.5 Replies
example: https://stackblitz.com/edit/github-ymwtfu?file=app.vue,server%2Fapi%2Fhello.ts,server%2Futils%2Ftiming.ts
first load, and page refresh should show Loading, shouldn't it?
StackBlitz
Nuxt - Starter - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
or is that more of a 'streaming' response thing, and not supported
hi š useLazyFetch and useLazyAsyncData are lazy only on page switch on client side. It still blocks the SSR render
GitHub
status
property for useAsyncData
/useFetch
(+ lazy equivalents...Describe the feature Follow-up of #15714 This feature request should provide a more fine-grained check of the status of useFetch/useAsyncData (and the lazy equivalents) by introducing a status ref ...
GitHub
useAsyncData
return value that pending
is true
at server side...Environment Operating System: Linux Node Version: v16.14.2 Nuxt Version: 3.0.0 Nitro Version: 1.0.0 Package Manager: [email protected] Builder: vite User Config: - Runtime Modules: - Build Modules: - Repr...
Used āserver: falseā to avoid blocking page render