nextjs - 💡(How to fix) Fix Navigation takes a few seconds up to a minute in production builds [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vercel/next.js#84469Fetched 2026-04-08 02:19:13
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
closed ×1commented ×1labeled ×1locked ×1

We have a dashboard application in next(15.5.4) that fetches data from an API that takes around 100ms. We have a few buttons (next/link) that update the current URL only with a get parameter called start. Like so:

<Link
  scroll={false}
  prefetch={false}
  href={{
    query: {
	    start: props.start, // e.g. "-1 hour"
    },
  }}
  className={clsx(
    !props.isReset && "border border-gray-100",
    "select-none rounded-md px-3 py-2 text-xs text-gray-700 hover:bg-gray-50 hover:text-gray-500",
    props.currentStart === props.start &&
	    "bg-primary-100/10 !text-gray-500"
  )}
...

When we navigate using this link inside production builds, we see in our backend that the request already completed to fetch the needed data, but the page does not update. The strange thing is, it sometimes takes a few seconds or even a minute just to re-render/update the current UI. The UI is not complicated, it just a table that displays the raw data.

The strange thing is this does not happen all the time, sometimes it updates directly after the API fetch is done (like we see in dev builds).

We use the app router and our route structure is:

  • [id]
    • somepage
      • [otherId]
        • page.tsx (has the start query parameter)

My question is: What happens here, and how could we fix this? Unfortunately, I can't share the project as it's an internal project. I'm also not able to reproduce this in a clean/new next app.

Root Cause

We have a dashboard application in next(15.5.4) that fetches data from an API that takes around 100ms. We have a few buttons (next/link) that update the current URL only with a get parameter called start. Like so:

<Link
  scroll={false}
  prefetch={false}
  href={{
    query: {
	    start: props.start, // e.g. "-1 hour"
    },
  }}
  className={clsx(
    !props.isReset && "border border-gray-100",
    "select-none rounded-md px-3 py-2 text-xs text-gray-700 hover:bg-gray-50 hover:text-gray-500",
    props.currentStart === props.start &&
	    "bg-primary-100/10 !text-gray-500"
  )}
...

When we navigate using this link inside production builds, we see in our backend that the request already completed to fetch the needed data, but the page does not update. The strange thing is, it sometimes takes a few seconds or even a minute just to re-render/update the current UI. The UI is not complicated, it just a table that displays the raw data.

The strange thing is this does not happen all the time, sometimes it updates directly after the API fetch is done (like we see in dev builds).

We use the app router and our route structure is:

  • [id]
    • somepage
      • [otherId]
        • page.tsx (has the start query parameter)

My question is: What happens here, and how could we fix this? Unfortunately, I can't share the project as it's an internal project. I'm also not able to reproduce this in a clean/new next app.

Code Example

<Link
  scroll={false}
  prefetch={false}
  href={{
    query: {
	    start: props.start, // e.g. "-1 hour"
    },
  }}
  className={clsx(
    !props.isReset && "border border-gray-100",
    "select-none rounded-md px-3 py-2 text-xs text-gray-700 hover:bg-gray-50 hover:text-gray-500",
    props.currentStart === props.start &&
	    "bg-primary-100/10 !text-gray-500"
  )}
...

---

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:56 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 11
Binaries:
  Node: 24.2.0
  npm: 11.3.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.3
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: standalone
RAW_BUFFERClick to expand / collapse

Summary

We have a dashboard application in next(15.5.4) that fetches data from an API that takes around 100ms. We have a few buttons (next/link) that update the current URL only with a get parameter called start. Like so:

<Link
  scroll={false}
  prefetch={false}
  href={{
    query: {
	    start: props.start, // e.g. "-1 hour"
    },
  }}
  className={clsx(
    !props.isReset && "border border-gray-100",
    "select-none rounded-md px-3 py-2 text-xs text-gray-700 hover:bg-gray-50 hover:text-gray-500",
    props.currentStart === props.start &&
	    "bg-primary-100/10 !text-gray-500"
  )}
...

When we navigate using this link inside production builds, we see in our backend that the request already completed to fetch the needed data, but the page does not update. The strange thing is, it sometimes takes a few seconds or even a minute just to re-render/update the current UI. The UI is not complicated, it just a table that displays the raw data.

The strange thing is this does not happen all the time, sometimes it updates directly after the API fetch is done (like we see in dev builds).

We use the app router and our route structure is:

  • [id]
    • somepage
      • [otherId]
        • page.tsx (has the start query parameter)

My question is: What happens here, and how could we fix this? Unfortunately, I can't share the project as it's an internal project. I'm also not able to reproduce this in a clean/new next app.

Additional information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:56 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T6030
  Available memory (MB): 36864
  Available CPU cores: 11
Binaries:
  Node: 24.2.0
  npm: 11.3.0
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.5.4 // Latest available version is detected (15.5.4).
  eslint-config-next: 15.5.3
  react: 19.1.1
  react-dom: 19.1.1
  typescript: 5.9.2
Next.js Config:
  output: standalone

Example

No response

Originally posted by @RemcoSmitsDev in https://github.com/vercel/next.js/discussions/84370

extent analysis

TL;DR

The issue can be resolved by optimizing the re-rendering of the page after navigating to a new URL with a updated query parameter, potentially by using a more efficient data fetching approach or optimizing the component tree.

Guidance

  • Verify that the getStaticProps or getServerSideProps methods are not being used in a way that could cause the page to not re-render after navigating to a new URL with an updated query parameter.
  • Check if the useEffect hook is being used to fetch data when the component mounts, and if so, consider adding a dependency to the effect so that it re-runs when the query parameter changes.
  • Consider using useRouter from next/router to access the router object and manually trigger a re-render when the query parameter changes.
  • Investigate if there are any unnecessary re-renders or slow component trees that could be causing the delay in updating the UI.

Example

import { useRouter } from 'next/router';
import { useEffect } from 'react';

function Page() {
  const router = useRouter();
  const { start } = router.query;

  useEffect(() => {
    // Fetch data when the component mounts or when the query parameter changes
    fetchData(start);
  }, [start]);

  return (
    // ...
  );
}

Notes

The issue seems to be related to the way Next.js handles client-side navigation and data fetching. The fact that it works sometimes and not others suggests that there might be a timing issue or a race condition involved.

Recommendation

Apply a workaround by optimizing the data fetching and re-rendering of the page, such as using useRouter to manually trigger a re-render when the query parameter changes. This approach can help mitigate the issue until a more permanent fix can be found.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING