-
Notifications
You must be signed in to change notification settings - Fork 85
feat: pages not present at build throw 404 #1726
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
base: main
Are you sure you want to change the base?
feat: pages not present at build throw 404 #1726
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The issue reported in https://github.com/SigNoz/engineering-pod/issues/2689 is resolved by this. ![]() ![]() ![]() |
if (child.props.value === activeTab) | ||
return <div key={child.props.value}>{child.props.children}</div> | ||
if ((child.props as any).value === selectedTab) | ||
return <div key={(child.props as any).value}>{(child.props as any).children}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use correct types, avoid using any
|
||
export default function TopNavStaticContent() { | ||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use React Fragment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor UI comments, feel free to pick them up in the next PR.
📄 PR Summary
When a non-existent page is accessed, the UI correctly renders a "404 - Page Not Found" screen. However, the server responds with a 200 OK status instead of 404 Not Found.
The changes made in the PR solve for this behaviour for the given routes:
Since these pages are also present in sitemap, it is important that they follow SEO guidelines.
✅ Summary of Changes
Declaring "all params are known at build-time" (
export const dynamicParams = false
andexport const dynamic = 'error'
added to page.tsx files for dynamic routes)Ref -
https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamicparams
https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic
Components which use useSearchParams() wrapped in a suspense boundary (to avoid CSR bailouts) with a static fallback (to ensure SEO compliance)
Ref -
https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout
https://nextjs.org/docs/app/getting-started/partial-prerendering#dynamic-rendering
Made GrowthBookProvider a client component (uses cookies())
Other refs -
🧪 How to Test
Visit any page on the routes above
🔍 Related Issues
Solves https://github.com/SigNoz/engineering-pod/issues/2689
📸 Screenshots / Screen Recording (if applicable / mandatory for UI related changes)
Before:
https://github.com/user-attachments/assets/9b15dfb4-f2cc-42cf-9a09-ff6987c19285
After:
https://github.com/user-attachments/assets/3754465e-c9c2-4e17-af88-155aaa9552a5