Skip to content
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

Error: Hydration failed because the initial UI does not match what was rendered on the server. Warning: Expected server HTML to contain a matching <p> in <svg>. Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering. #31

Open
bibekrawat2020 opened this issue Dec 16, 2023 · 1 comment

Comments

@bibekrawat2020
Copy link

When I add in Navbar.tsx by following video from youtube and start local server there occurs 3 errors:

        <div className="container max-w-7xl h-full mx-auto flex items-center justify-between gap-2">
            {/* { logo } */}
            <Link href='/' className="flex gap-2 items-center">
                <p className="hidden text-zinc-700 text-sm font-medium md:block">Breadit</p>
            </Link>
        </div>

The error above occurs.

@okieLoki
Copy link

well since he used server component for the navbar so you can't use useEffect to solve this issue
one way to do that would be taking everything from the navbar and create a new component, pass session over there as a prop and in the old navbar component use useEffect to remove the warning

or you can use supressHydrationError (idk why it's not working for react 18+) 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants