-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Enhancement: New 404 Page #1082
Comments
Should I add the navbar on the 404 page? |
@IyaadDev it would be really great if you propose some UI designs. |
👍 |
will provide some later this week* |
Quick question: [slug].page.tsx seems to cover all pages, I've tried changing the code a bit so that 404 errors are displaying the page on 404.tsx, but it doesn't seem to work... any potential solutions? export async function getStaticPaths() {
// Adjusted to extract 'paths' directly
const { paths } = await getStaticMarkdownPaths('pages');
return {
paths,
fallback: false, // Show 404 for unknown paths
};
}
export async function getStaticProps(args: any) {
// Adjusted to extract 'props' directly
const result = await getStaticMarkdownProps(args, 'pages');
if (
!result ||
!result.props ||
!result.props.frontmatter ||
!result.props.content
) {
return {
notFound: true, // Trigger 404 page
};
}
// Return the 'props' object
return {
props: result.props,
};
} |
@IyaadDev this can be helpful https://nextjs.org/docs/14/pages/building-your-application/routing/custom-error |
@DhairyaMajmudar what do you think of this design? |
@AQIB-NAWAB Looks cool 💯 |
Okk nice , I will develope according to this design |
I'll be away for a while, @AQIB-NAWAB looks like he's doing a good job so far 👍 |
Just a quick proposal for your design: perhaps change the casing on the "back home" button |
In addition, installing the 404 page may mean modifying the error handling process in _error, personally, I still haven't figured out how to do it yet... |
Thank you! @AQIB-NAWAB you can go ahead with your PR. |
Hi, Is this issue still open for contribution? If yes, I’d love to work on it. |
Yep, still open :) |
thanks... will drop a pr soon |
Is your feature request related to a problem? Please describe
Not really, it's just that I find it unusual that the website still appears to be using the default 404 page
Describe the solution you'd like
I'd like to design a 404 page incorporating the json-schema branding and theming
Describe alternatives you've considered
No response
Additional context
When a user gets a 404 error, is there any place that the error is being logged? If there is an error detection method in place, the code needs to be incorporated into the new 404 page
Are you working on this?
Yes
The text was updated successfully, but these errors were encountered: