Open AnthonyPaulO opened 1 year ago
Start a new pull request in StackBlitz Codeflow.
Referenced Discord channel & a video of the issue
https://i.imgur.com/RYvr7sq.gif
https://discord.com/channels/842438759945601056/1108776276916973578/1108776276916973578
Just to add a comment, during SPA navigation it works perfectly, the only issue I can see is on SSR (refreshing the page). Looks like a streaming issue, not a Resource
component issue itself.
Hello @manucorporat @zanettin
Same problem, querying an api and always getting unResolved. It doesn't work onPending and onRejected. I have tested the request to the api in server$ and routeLoader$ . Any idea why it doesn't work?
If this happens during SSR only it's a documented limitation because the server is waiting for the promose to be resolved in the server before it streams the rest of the renderred html (currently it can't come back and replace the "loading" to the resolve state)
But there is research that's being done on how to make it work afaik, so we will update as soon as we know
Thank you @shairez !
Any alternative solution that you recommend?
I think I have a similar issue? I have a Resource on page /foo. When navigating from /bar to /foo on SPA, it just waits until the resource is resolved before rendering anything, which obviously does not work for long-timed resources.
Edit: Wow this is embarrassing, I was missing my onPending callback...
Which component is affected?
Qwik Runtime
Describe the bug
<Resource onPending={...} /> not working; onResolved works just fine, I see the eventual result render on screen, but the "loading" message I want to display in the interim is never rendered.
Reproduction
https://stackblitz.com/edit/qwik-starter-7hecip?file=src%2Froutes%2Findex.tsx
Steps to reproduce
Go to repro link (created via qwik.new) and do 'npm run dev'
System Info
Additional Information
No response