Continuing figuring out bugs that I see in production on our website. Somewhat related to loading bugs from this issue: https://github.com/react-static/react-static/issues/1203.
Except this time it appears to be a similar issue but in react-static itself. I have not verified this, but it really looks wrong to me.
What I see is sometimes when I load the index page of our website and move to some other page real quick, it fails with an error. If you dig down into the error, it's one of the sharedData props being "undefined". Let's see how sharedData is loaded:
We have this snippet that is within prefetchData function, which is called from prefetch function itself. As far as "prefetch" goes, it can be called multiple times for the same component. Prefetch is initiated from ticker which prefetches stuff for visible links and then prefetch also might be called from useRouteData even (which can throw a promise for suspense to handle it). The problem is that once you enter "prefetchData" function, it sets the empty object on sharedData property routeInfo.sharedData = {} and goes into some async stuff, which in turns makes other code think sharedData is already loaded. But the loading is not complete.
So, a hypothetical scenario:
End result - I get my "undefined" error when trying to access some of the props (sharedData props) of useRouteData() result.
Is there any progress about this issues?
What does the fail look like? Curious to see if we got the same issue...
Most helpful comment
Is there any progress about this issues?