Menu

My Next.js loading.tsx moved every page's content into a hidden div after the footer
📰

My Next.js loading.tsx moved every page's content into a hidden div after the footer

DEV Community: nextjs·Moonwaves·1 day ago
#E1M5W9eF
#devtonextjs#devto#dev#html#skeleton
Long article (1007 words) — no AI summary yet.
Reading 0:00
15s threshold

I run eSIMLane , a travel eSIM price comparison site built with Next.js (App Router) and deployed to Cloudflare Workers via OpenNext. It has around 1,150 prerendered pages.

When I checked my analytics, ChatGPT turned out to be my main source of real visitors, while Google sent almost nobody. Since AI assistants matter that much to me, I fetched a few pages the way a simple crawler would (plain HTTP, no JavaScript) and read the raw HTML.

What a non-JS crawler saw

Inside <main> , there were only skeleton blocks: grey aria-hidden placeholder divs. All the actual content (price tables, quick answers, FAQs) was in the document, just pushed down after the footer inside a block like this:

<div hidden id = "S:0" > …the whole page… </div> <script> $RC ( "B:0" , "S:0" ) </script>

Enter fullscreen mode

Exit fullscreen mode

$RC is React's streaming helper. In a browser it moves the hidden segment up into the Suspense boundary as soon as the script executes.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.