Skip to content

Custom Error pages are rendered instead of passing 404 or 500 as params to page with dynamic path #55894

@akshitkrnagpal

Description

@akshitkrnagpal

Link to the code that reproduces this issue

https://github.com/akshitkrnagpal/nextjs-custom-errors-bug

To Reproduce

  1. Create file [id]/page.tsx in app directory.
const Page = ({ params }: { params: { id: string } }) => {
  return <div>Page {params.id}</div>;
};

export default Page;
  1. Visit /500 or /404

Current vs. Expected behavior

Current Behaviour

When running locally

  1. Visting /404 renders "Page 404".
image
  1. Visting /500 renders "Page 500".
image

When deployed to Vercel

  1. Visting /404 renders 404 page.
image
  1. Visting /500 renders 500 page.
image

Expected Behaviour

When deployed to Vercel also page should be rendered. (like local)

image image

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: Thu Aug 17 21:23:05 PDT 2023; root:xnu-10002.1.11~3/RELEASE_ARM64_T6000
Binaries:
  Node: 18.16.1
  npm: 9.5.1
  Yarn: 1.22.19
  pnpm: 8.7.5
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

I have a deployed version to https://nextjs-custom-errors-bug.vercel.app.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.not staleA previously `stale` marked issue that is no longer stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions