vercel / vercel/next.js

Static indicator shouldn't be shown when searchParams is being used

Open
#72,133 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug linear: next
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/awesome-shockley-46z7c5

To Reproduce
  1. Start the dev server
  2. Create a new page and use searchParams
export default async function Page({
  searchParams,
}: {
  searchParams: Promise<{a: string}>;
}) {
  const sp = await searchParams;

  return (
    <div>
      <p>sp: {sp.a}</p>
    </div>
  );
}
  1. Visit the page on the browser and the static indicator should not be shown here since searchParams is considered a Dynamic API

Build time:
In the build time process, though, the page is correctly rendered as a dynamic page (the /sp route):
image

Current vs. Expected behavior

The static indicator should not be shown here since searchParams is considered a Dynamic API.

Provide environment information
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Sun Aug  6 20:05:33 UTC 2023
  Available memory (MB): 4102
  Available CPU cores: 2
Binaries:
  Node: 20.9.0
  npm: 9.8.1
  Yarn: 1.22.19
  pnpm: 8.10.2
Relevant Packages:
  next: 15.0.3-canary.2 // Latest available version is detected (15.0.3-canary.2).
  eslint-config-next: N/A
  react: 19.0.0-rc-603e6108-20241029
  react-dom: 19.0.0-rc-603e6108-20241029
  typescript: 5.3.3
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Developer Experience

Which stage(s) are affected? (Select all that apply)

next dev (local)

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodeSandbox and reproduce the behavior in next dev using a page that awaits searchParams. Then trace the next dev static indicator handling for Dynamic APIs and verify that the indicator is absent while the /sp route remains dynamic at build time.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs, react, typescript
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.