Menu

Google saw 1 word on my Next.js homepage. A Suspense boundary was hiding everything else.
📰

Google saw 1 word on my Next.js homepage. A Suspense boundary was hiding everything else.

DEV Community: react·Arsany·2 days ago
#johHKsiF
#devtoreact#devto#dev#children#boundary
Reading 0:00
15s threshold

Last night I ran an SEO audit on Ilytics, the analytics tool I've been building, and it came back with 0 words on every page.

I assumed the audit tool was broken. The site looked fine in my browser. So I fetched the homepage the way a crawler does, with curl and a Googlebot user agent, and counted the words in the HTML. There was exactly one: "Ilytics", from the page title. No headings, no text, no links to my other pages.

The fix ended up being about twenty lines. It's an easy mistake to make in the App Router, so I'm writing it up.

The provider that wrapped everything

My root layout wraps the whole app in an analytics provider, which is how most PostHog setups for Next.js look:

// app/layout.tsx < PostHogProvider > { children } </ PostHogProvider >

Enter fullscreen mode

Exit fullscreen mode

Inside, the provider reads the URL so it can send a pageview whenever the path or query string changes.…

Continue reading — create a free account

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