Next.js Discord

Discord Forum

Hydration error (tailwindCSS)

Unanswered
Cane di Oropa posted this in #help-forum
Open in Discord
Cane di OropaOP
I'm getting a hydration error
"use client";
import "../../globals.css";

export default function LoginPage() {
  return (
    <div className="flex justify-center items-center">
      <div className="bg-white shadow rounded p-6 my-6 w-5/12">
        <div className="text-center">
          <div className="text-black text-3xl font-medium mb-3">
            Welcome Back
          </div>
          <span className="text-gray-600 font-medium line-height-3">
            Don't have an account?
          </span>
          <a className="font-medium no-underline ml-2 text-blue-500 cursor-pointer">
            Create today!
          </a>
        </div>

        <div>
          <label htmlFor="email" className="block text-900 font-medium mb-2">
            Email
          </label>
          <input
            type="text"
            id="email"
            className="w-full border border-gray-300 rounded p-2 mb-3"
          />
        </div>
      </div>
    </div>
  );
}

14 Replies

Giant panda
I can't reproduce the issue. You sure this isn't a temporary hiccup?
Cane di OropaOP
weird, i did a clean install of node_modules, deleted .next
Giant panda
The error is unrelated to Tailwind anyways. It's an error indicating invalid DOM nesting. I can't reproduce it. So if you still have it, the layour of the page might be causing issues.
Cane di OropaOP
I think i might of got a idea
I think it's as of a password manager filling in a email
Giant panda
Oh yeah, disable plugins or work in incognito mode to prevent plugins from causing false positives.
Cane di OropaOP
hm even safari gives a error
but not on initial load, only after doing a reloading using cmd+r
Giant panda
What's the error in the browser console when that occurs?
Cane di OropaOP
Giant panda
Not happening on my end. Did you run this Incognito?
Cane di OropaOP
yep, weird
Giant panda
Then it's indicative that your layout surrounding it is possibly interfering
Great Knot
The error mention clearly there is 3 div wrapped above LoginPage. The issue should be with the wrapper.