question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content never loads if prefetching fails

See original GitHub issue

It appears that react-static has buggy or non-existent recovery after failure when preloading resources.

To Reproduce Steps to reproduce the behavior:

  1. Open a react-static site. For example, react-static.js.org. Let the page load.
  2. Turn off your connection (turn off wifi or click “offline” in devtools > network)
  3. Click “Documentation” or “Get Started!”
  4. The content has preloaded and should show up despite your network being offline. However, it tries to preload additional content, which fails (you can see errors in the console).
  5. Turn on your connection again.
  6. Click e.g. “Changelog” in the sidebar navigation.
  7. You get a 404 page even though you have a working connection and should be able to fetch the content.

Expected behavior I expected react-static to try to fetch the content again if it failed. With the current behavior, the only way for users to recover is to do a “full” refresh of the page.

I believe it might possible to work around by importing axios and using interceptors, but it really seems like that should not be needed?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Dec 8, 2018

This is fixed in the next version. Try the beta!

On Sat, Dec 8, 2018 at 12:40 PM Dragomir Ivanov notifications@github.com wrote:

Nope, not stale

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nozzle/react-static/issues/839#issuecomment-445484453, or mute the thread https://github.com/notifications/unsubscribe-auth/AFUmCUAy-cSjnFGNan0a_oPQDOyERwv3ks5u3BWPgaJpZM4X6pGt .

0reactions
tannerlinsleycommented, Dec 12, 2018

As of right now, I don’t not know of a way to fix it in v5 without introducing a major overhaul of how the v5 components work. And it would likely be a breaking change. I’m open to discuss it though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3041 - DNS pre-fetching causes frequent internet loss - Monorail
spinner never stops. I'm using Windows 7 64bit and Google Chrome dev channel v. 4.0.249.11. Now here's the kicker, and why I think...
Read more >
Content Pre-fetching Best Practice - AT&T Developer
Content Prefetching looks at how prefetching works, describes some issues involved in content management, and provides recommendations for how to use ...
Read more >
Prefetching, preloading, prebrowsing - CSS-Tricks
A new spec called preload suggests that sometimes it's best to always download an asset, regardless of whether the browser thinks that's a...
Read more >
The problem with prefetch - LWN.net
Prefetching is useful when you actually know you'll be doing sequential accesses (still only if you do it on background). This is almost...
Read more >
When Prefetching Works, When It Doesn't, and Why
If prefetched blocks by software prefetching hide a part of one or more streams, the hardware prefetcher will not be trained properly. Also,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found