Skip to content

Content never loads if prefetching fails #839

@trbrc

Description

@trbrc

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions