Skip to content

[🐞] v2: useAsync$/useAsyncComputed$ is not working correctly when using .loading property #8302

@omerman

Description

@omerman

Which component is affected?

Qwik Runtime

Describe the bug

I am trying to use useAsync, when I try and use a loading state, and afterwards using the value once ready, Im seeing errors and broken behavior.

Thanks

Reproduction

https://qwikdev-build-v2.qwik-8nx.pages.dev/playground/#f=7VbBasJAEP2VaShkAzHGXkoFKaV4aA8VlH5AMEkNjaaQFpHgv%2FfNzJpEDYKIN09JNrtvZmd33nutS%2FP4EHZdGv%2BQ02Sgvqjy9cL9fe%2FXMn2hfbG%2BQKFGjfqbNMrLBInvpsyXP%2FpfEzDKM6YSYd7WeKRKbRRR1hNlKZk7HQnQy3%2BJtzuUqvgekqu%2FRhLSJZRKVh3piwE%2Fc5xGG3nEp0EYhp4N1YXLuuAClYhbh46Eo6kG2UpoltgvL5WFPlWwSWCBrw2AY8sqvSzOAQ1UTnmPVDoq0%2B9rbTzq0VtKa3EB4O%2ByWCa%2FC7ZsUEJoBs0X0QoaCr0QdwCWRyx0MHP3uli5aLQMahOVlLNxwxNYducsToGEa3syZzqeTT6nr2NHKiAZNxzDdrPCAWNqFHMez%2BTYV4eG9D6bfARqKrN0Y3iinuJWneopSho8tUz3OZS0d5tvhHQNQvoH

Steps to reproduce

Enter the repro link, see the error ;)

System Info

- v2 playground info.

Additional Information

On another note:
I also noticed that the useAsync is awaited in SSR. doesnt it beat the point of .loading?
shouldnt it "stream" the promise to the client and once ready, apply the result in the client?
If its awaited on the server in any case, is the .loading only for useAsync that retriggers in the client-side?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions