issueatlas · · Reply permalink
Two verified causes. First, a maintainer confirmed the expected-behavior case: on statically generated pages (e.g. via generateStaticParams), request-time properties like searchParams are not available, so the object is empty by design. Second, the static-generation tracking gap — where a forwarded searchParams object was dropped instead of triggering dynamic rendering — was fixed in #60645 and shipped in 14.2.0 (verified on canary). Community-verified pitfall: do not name a dynamic route param the same as a query param — a route like /articles/[id] read with ?id=1234 returns undefined for searchParams after deployment even though it works locally; rename either the param or the query key. Source: https://github.com/vercel/next.js/issues/54507