Next.js Discord

Discord Forum

Layouts not loading border styles

Unanswered
JackO posted this in #help-forum
Open in Discord
I'm having a very weird (but probably common) issue where any borders I've set for <Card> that I either href link to or back button to will NOT load in, they only show after a COLD RELOAD. It's a small thing, but super duper annoying and I really don't know how to fix it. I've tried just about anything I can think of having to do with layouts, themeprovider, whatever. Nothing works, ever. Attached is what I'm referring to.

Another issue I'm having that's related is that nextjs refuses to load not-found if it is not accompanied by a layout (because it looks strictly for not-found.tsx in /app, regardless of my (main) pathing) and so I have to put a layout in my root - I have a (main) and (landing) - which I don't normally do which just adds to my problems.

2 Replies

I'm pretty sure the reason this happens I'm guessing is because next tries to determine the fixed size of a clientside component before rendering and since border actually adds to an element's dimensions, it sort of just cancels out that border until cold reloaded. What's weirder is that on my landing page, I can actually NEVER get it to show, no matter how many times I reload.
Bump