N
Nuxt•2y ago
dmarr

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
dmarr
dmarrOP•2y ago
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.
dmarr
dmarrOP•2y ago
or is that more of a 'streaming' response thing, and not supported
Julien
Julien•2y ago
hi šŸ‘‹ useLazyFetch and useLazyAsyncData are lazy only on page switch on client side. It still blocks the SSR render
manniL
manniL•2y ago
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...
dmarr
dmarrOP•2y ago
Used ā€˜server: false’ to avoid blocking page render

Did you find this page helpful?