fix: wrap dynamic components in Suspense to fix build and add My Bookings to Navbar [fixes #56]#60
Conversation
|
@Aarush2112 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Too much diff to scan? Review this PR in Change Stack to start with the highest-impact changes. 📝 WalkthroughWalkthroughThe root layout now imports ChangesLayout Suspense and Bookings Navigation
Sequence DiagramsequenceDiagram
participant Browser
participant RootLayout
participant PostHogProvider
participant SuspenseBoundary
participant NavbarFallback
participant Navbar
Browser->>RootLayout: Render layout
RootLayout->>PostHogProvider: Wrap children
PostHogProvider->>SuspenseBoundary: Begin suspense boundary
SuspenseBoundary->>Navbar: Start rendering navbar
Navbar-->>SuspenseBoundary: Suspend (async loading)
SuspenseBoundary->>NavbarFallback: Show fallback
NavbarFallback-->>Browser: Render sticky glass header skeleton
Navbar-->>SuspenseBoundary: Resolve
SuspenseBoundary->>Navbar: Replace fallback with navbar
Navbar-->>Browser: Render full navbar
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@Aarush2112 write issue no too |
|
@Aarush2112 resolve conflicts too |
|
@SatyamPandey-07 Solves issue no #56 |
Description
This Pull Request resolves the unresponsive/outdated navbar links issue by fixing Next.js production build failures and adding the missing dashboard navigation link:
Navbar(which callsusePathname()) andPostHogProvider(which internally tracks search params and routes) in<Suspense>boundaries withinapp/layout.tsx. This stops Next.js from crashing withUncached data was accessed outside of <Suspense>during static site generation on dynamic routes like/events/[slug].Navbarcomponent, resolving navigation to the dashboard/my-bookingsas outlined in the project's setup guide.Fixes # (issue number if applicable)
Type of Change
How Has This Been Tested?
MONGODB_URI=mongodb://localhost:27017/dummy npm run buildto verify the production compiler runs to completion without any dynamic prerendering errors.http://localhost:3001and tested the navbar links sequentially (Home -> Events -> Create Event -> My Bookings -> Home) using automated browser interactions to ensure links correctly redirect the user and change paths.Checklist:
Summary by CodeRabbit
New Features
Improvements