Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pages using searchParams are still rendered (unnecessarily) during build #55863

Closed
1 task done
joulev opened this issue Sep 23, 2023 · 1 comment
Closed
1 task done
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@joulev
Copy link
Contributor

joulev commented Sep 23, 2023

Link to the code that reproduces this issue

https://github.com/joulev/debug/tree/nextjs-some-more-bugs

To Reproduce

next build

Current vs. Expected behavior

The page beers uses the searchParams prop so should only be rendered during request time. But it is still rendered during build time, notice the "this is run" logs below:

image

The page is correctly run again during request time, but the run during build is completely unnecessary and should not happen.

If I explicitly opt into dynamic rendering with export const revalidate = 0, the bug doesn't happen.

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:57 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8112
Binaries:
  Node: 20.3.1
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 8.6.12
Relevant Packages:
  next: 13.5.3-canary.3
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

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

App Router

Additional context

Related to #55702 where behaviours also differ between implicit dynamic rendering and explicit dynamic rendering.

@joulev joulev added the bug Issue was opened via the bug report template. label Sep 23, 2023
@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label Mar 21, 2025
@joulev joulev closed this as completed Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants