Skip to content

Add params prop for not-found page [have questions] - #59948

Closed
alexdln wants to merge 1 commit into
vercel:canaryfrom
alexdln:not-found-params
Closed

Add params prop for not-found page [have questions]#59948
alexdln wants to merge 1 commit into
vercel:canaryfrom
alexdln:not-found-params

Conversation

@alexdln

@alexdln alexdln commented Dec 26, 2023

Copy link
Copy Markdown
Contributor

Adding a feature

What?

Passing parameters for not-found errors

Why?

Dynamic 404 errors are needed. The most vivid example is a localized error within the [lang] directory (which is suggested in the next.js documentation for internationalization).

In any case, the 404 page in this directory should be localized (for example, if a user from Germany stumbles upon a deleted post or FAQ).

Currently, to achieve this, either all translations and data need to be passed to the client or the language needs to be determined from the headers (after adding it to the middleware), thus making the page dynamic.

How?

I simply pass the parameters of the current segment to the NotFound component. It worked as expected during manual tests.

Questions

Can you explain why this was not done initially?

If this solution is acceptable, I will write tests and finalize the pull request. Otherwise, please describe the cases, and I might be able to come up with a solution.

Fixes #43179

@ijjk

ijjk commented Dec 26, 2023

Copy link
Copy Markdown
Member

Allow CI Workflow Run

  • approve CI run for commit: 4af4eaa

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

2 similar comments
@ijjk

ijjk commented Dec 26, 2023

Copy link
Copy Markdown
Member

Allow CI Workflow Run

  • approve CI run for commit: 4af4eaa

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk

ijjk commented Dec 26, 2023

Copy link
Copy Markdown
Member

Allow CI Workflow Run

  • approve CI run for commit: 4af4eaa

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@alexdln
alexdln marked this pull request as ready for review January 2, 2024 18:57
@alexdln alexdln closed this Mar 18, 2026
@github-actions github-actions Bot added the locked label Apr 2, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants