N
Nuxt3mo ago
alex pixel

nuxi generate, nested useAsyncData, not working

I have set experimental: { asyncContext: true } in nuxt.config.ts (nuxt3 project). I use multiple useAsyncData in the component tree. It works with SSR, but when I try to do a nuxi generate it fails with 500 Errors (strangely only, after the first page). I logged it and it seams that the second useAsyncData isn't executed at all in SSG. Also tried a callWithNuxt but that didn't work either. Is it known that asyncContext: true doesn't work with SSG? Is this expected behaviour? Any workarounds/tips for this kind of problem?
2 Replies
Cue
Cue3mo ago
Not that I’m aware of. Can you provide something we can reproduce?
alex pixel
alex pixelOP3mo ago
Thanks for responding. While trying to reproduce it I found some issues in my useAsyncData functions. I think the payload wasn't serializable which didn't resulted in error on SSR and Client Side, but in SSG. In my simple project code I could use nested useAsyncData functions from different components and don't needed experimental: { asyncContext: true } but in my code I needed it because I use the nuxtApp in this parts of the code.
Want results from more Discord servers?
Add your server