open-tacos icon indicating copy to clipboard operation
open-tacos copied to clipboard

Duplicate html tag from extra layout in app router

Open greghart opened this issue 9 months ago • 1 comments

Steps to Reproduce

  1. Load any page from the app router (eg. https://stg.openbeta.io/pulse)
  2. Observe in source that there are two <html> tags
  3. No real user facing issues, I just noticed in local dev where during clientside hydration it notices the disconnect

src/app/Layout.tsx will be used for all routes due to how layouts work. Fix should be to either:

  • let root layout be the only layout that sets up html and body tags
  • don't have a root layout at all, and have not found setup its' own html and body tags

Screenshots

Image

Expected Behavior

Just one html tag

Current Behavior

Two html tags

Browser & version

Chrome

Operating system

Windows

greghart avatar Feb 26 '25 01:02 greghart

I've fixed the duplicate HTML tags issue by:

  1. Removing the <html> and <body> tags from src/app/(default)/layout.tsx
  2. Keeping the HTML structure only in the root layout (src/app/layout.tsx)
  3. Renaming the component from RootLayout to DefaultLayout for clarity

The changes ensure that:

  • Only one set of HTML/body tags exists in the page source
  • The hydration process works correctly without any disconnects
  • All functionality (auth, header, footer) remains intact

PR: #1314

vishalpatel011 avatar Mar 23 '25 17:03 vishalpatel011

Completed.

mikeschen avatar Apr 28 '25 15:04 mikeschen