Header/Footer randomly disappears in App Router layout. #82144
Replies: 1 comment
-
Hi @wajidafridi, Thanks for the details and repo link. The header/footer disappearing randomly during navigation is likely due to how Next.js App Router handles streaming and async data fetching. Possible causes: Suspense or data fetching race conditions causing parts of layout to temporarily not render. Streaming rendering quirks in React 18 that can omit layout content briefly. Cache invalidation or ISR causing incomplete renders. Hydration issues from client/server component boundaries. Suggestions: Wrap layout content in Suspense with a fallback that always shows header/footer placeholders. Make header/footer static or load their data early to avoid suspension. Avoid dynamic keys/props on header/footer that trigger remounts. Test disabling ISR/revalidate to isolate caching effects. Check for subtle hydration warnings. If issue persists, open a minimal repro issue for Next.js team. Your repo will help investigate. Let me know if you want help with that. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I’m using Next.js 15 App Router and noticed that Header/Footer, which is defined in the root layout.jsx, sometimes disappears randomly when navigating between certain authenticated routes like /user, /user/wishlist, /user/my-orders, etc.
This happens very rarely (maybe 1 in 50 navigations), but when it does:
Additional information
Example
https://github.com/wajidafridi/nextjs-header-footer-disappears-app-router
Beta Was this translation helpful? Give feedback.
All reactions