nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using `getCachedData` together with `await useLazyAsyncData` causing it to not be pending anymore

SebbeJohansson opened this issue · comments

Environment

Nuxt project info: 1:24:04 AM


  • Operating System: Windows_NT
  • Node Version: v20.11.0
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: yarn@1.22.21
  • Builder: -
  • User Config: devtools, runtimeConfig, routeRules, storyblok, modules, vue, vite, components, app, css, postcss
  • Runtime Modules: @pinia/nuxt@0.5.1, @storyblok/nuxt@6.0.10
  • Build Modules: -

Reproduction

As far as i can tell this is pretty obvious and it seems to be happening in most nuxt3 projects.

Describe the bug

If useLazyAsyncData is used together with an await (to be able to show for example ghosts before the data has finished fetching) and together with a getCachedData function, the lazy async data is no longer returning pending and is instead waiting until the data is available (similar to how just a normal useAsyncData works).

Additional context

We found this issue while trying to use getCachedData to improve loading times since our app keeps fetching the same data on navigation.

Logs

No response