Skip to content

TypeError: Cannot destructure property 'parallelRouterKey' of 'param' as it is null. #58485

@sebpalluel

Description

@sebpalluel

Link to the code that reproduces this issue

https://github.com/sebpalluel/parallel-router-key-destructure-property-error

To Reproduce

  1. Install the packages with pnpm i
  2. Start the application in development with pnpm run dev
  3. The main page at http://localhost:3000/ is working, displaying a layout with parallel routes displayed conditionally in desktop or mobile view size.
  4. Go to any non existing page like http://localhost:3000/dummy. It will display an error message coming from next/dist/client/components/layout-router.js"TypeError: Cannot destructure property 'parallelRouterKey' of 'param' as it is null."

Current vs. Expected behavior

It should display the placeholder not-found.txs

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 22.5.0: Thu Jun  8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
Binaries:
  Node: 20.1.0
  npm: 9.7.1
  Yarn: 1.22.19
  pnpm: 8.9.2
Relevant Packages:
  next: 14.0.3-canary.9
  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

Additional context

When I comment out either AppNavLayoutDesktop or AppNavLayoutMobile in components/AppNavLayout.tsx, the error no longer occurs. Additionally, completely removing app/error.tsx also prevents the error, and instead, not-found.tsx is displayed as expected.

NEXT-2095

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions