Skip to content

Parallel routes - generateMetadata searchParams is undefined in default.tsx #59415

Closed as not planned
@IgordeSL

Description

@IgordeSL

Link to the code that reproduces this issue

https://github.com/IgordeSL/repro-search-params

To Reproduce

1 - Clone the repo
2 - Install dependencies run yarn
3 - Start application yarn dev and open http://localhost:3000/
4 - Click on the link Go to a route
5 - Reload the page

Current vs. Expected behavior

Current:
In the @parallel/default.tsx file, the searchParams parameter of the generateMetadata function is always given an undefined value, but in the default function, which returns the component, the searchParams prop is given the correct value according to the URL

Expected:
Both the searchParams parameter of the generateMetadata function and the prop of the default function component are given the correct value according to the URL.

Verify canary release

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

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Thu Oct 5 21:02:42 UTC 2023
Binaries:
  Node: 20.10.0
  npm: 10.2.3
  Yarn: 1.22.19
  pnpm: N/A
Relevant Packages:
  next: 14.0.5-canary.2
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
Binaries:
  Node: 20.9.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.5-canary.2
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: N/A

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

App Router, Metadata (metadata, generateMetadata, next/head)

Additional context

I tested on my machine in Windows 11 and WSL Ubuntu

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.staleThe issue has not seen recent activity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions