Skip to content

defaultPendingMinMs blocks the page on load #1646

Closed

Description

@TkDodo

Describe the bug

when hard-loading a page for the first time, it will show the loader (or an empty page) for the pendingMinMs time even if the route has no loader at all or the loader resolves before pendingMs has expired (default 1 second).

This is not the case when navigating to a route

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-hzdror?file=src%2Fmain.tsx&preset=node

Steps to Reproduce the Bug or Issue

  • reload the sandbox on the Home tab (this route has no loader)
  • you should see an empty page for 5 seconds.
    • if you comment in the defaultPendingComponent, you should see loading... for 5 seconds.
  • now go to the about tab (which has a 500ms loader, so shorter than the default 1s pendingMs) and reload it.
    • you should, again see the loading... (or an empty screen) for 5 seconds
  • now navigate to Home via the link
    • home loads instantly, as expected, because it has no loader.

Expected behavior

I'd expect pendingMinMs to not influence the hard reload times, just like it doesn't block navigations either.

Screenshots or Videos

No response

Platform

any

Additional context

This behaviour is observable even with the default settings, but because defaultPendingMinMs is "just" 500ms, it's harder to spot.

Activity

  1. changed the title [-]defaultPendingMinMs blocks the page on load if no pendingComponent is defined[/-] [+]defaultPendingMinMs blocks the page on load[/+] on May 21, 2024
  2. acoBOYZ commented on May 23, 2024

    @acoBOYZ

    Yes I have the same issue.

  3. shevdrakon commented on May 24, 2024

    @shevdrakon

    In addition I can see that pendingMs is ignoring. Loading... will be displayed in 1s (default value) even if value was changed to smth big, i.e. 10_000.

    By default, TanStack Router will show a pending component for loaders that take longer than 1 second to resolve. This is an optimistic threshold that can be configured via: pendingMs

    I would expect not to see Loading... for 10s if loader not resolved.

  4. ericchernuka commented on Jul 6, 2024

    @ericchernuka

    This is an interesting one. I haven't dug in, but I just discovered this today also.

  5. schiller-manuel commented on Jul 16, 2024

    @schiller-manuel
    Collaborator

    this will be fixed by #1907

    reproducer with pre-release package: https://stackblitz.com/edit/tanstack-router-um44ng?file=src%2Fmain.tsx&preset=node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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