<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Waseem Khan</title>
    <description>The latest articles on DEV Community by Waseem Khan (@waseem_khan_d39ebce9da161).</description>
    <link>https://dev.to/waseem_khan_d39ebce9da161</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4252731%2F0fda5098-7ac9-4797-9881-2abf50dedec2.jpg</url>
      <title>DEV Community: Waseem Khan</title>
      <link>https://dev.to/waseem_khan_d39ebce9da161</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/waseem_khan_d39ebce9da161"/>
    <language>en</language>
    <item>
      <title>Google indexed 30 of my 547 pages. Here's what was wrong with my React SPA.</title>
      <dc:creator>Waseem Khan</dc:creator>
      <pubDate>Thu, 19 Nov 2026 00:33:33 +0000</pubDate>
      <link>https://dev.to/waseem_khan_d39ebce9da161/google-indexed-30-of-my-547-pages-heres-what-was-wrong-with-my-react-spa-538j</link>
      <guid>https://dev.to/waseem_khan_d39ebce9da161/google-indexed-30-of-my-547-pages-heres-what-was-wrong-with-my-react-spa-538j</guid>
      <description>&lt;p&gt;I run &lt;a href="https://gagpedia.com" rel="noopener noreferrer"&gt;GAGPedia&lt;/a&gt;, a free fan-made calculator and guide site for the Roblox game Grow a Garden: trade (Win/Fair/Loss) checks, plant values with mutation multipliers, pet XP tools, a codes page and some strategy guides. It's a Vite + React + TypeScript single-page app on Vercel, with game data in Supabase.&lt;/p&gt;

&lt;p&gt;After eight months live, Search Console looked like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;547&lt;/strong&gt; URLs in the sitemap, &lt;strong&gt;30&lt;/strong&gt; indexed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;508&lt;/strong&gt; "Discovered – currently not indexed"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;39&lt;/strong&gt; clicks from Google in total&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Meanwhile Bing (plus Yahoo and DuckDuckGo, which use its index) was sending roughly ten times more search visits than Google. So the pages weren't broken. Google just didn't think most of them were worth indexing. Here's what I found and fixed, in order of impact.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. 487 pages that were 80% the same
&lt;/h2&gt;

&lt;p&gt;The site generated a page for every pet (372) and every plant (115). Each one came out of the same template: about 325 words, of which one or two sentences were actually unique (an XP rate, a rank, a tier). I diffed two pet pages and they were 80% identical word for word.&lt;/p&gt;

&lt;p&gt;That's textbook thin programmatic content, and on a young site with few backlinks it doesn't just fail to rank — it drags down how Google sees everything else.&lt;/p&gt;

&lt;p&gt;Deleting the pages wasn't an option, since Bing ranks them and players use them. So the fix is a &lt;strong&gt;Googlebot-only&lt;/strong&gt; noindex, which other crawlers ignore:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"googlebot"&lt;/span&gt; &lt;span class="na"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"noindex, follow"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;follow&lt;/code&gt; keeps link equity flowing from those pages to the calculators and hub pages. I also dropped them from &lt;code&gt;sitemap.xml&lt;/code&gt;, which went from 547 URLs to 60: the pages I actually want in Google. The rule lives in one constant, so a page can come back once it has real unique content.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. My best articles were 120 words long (to a crawler)
&lt;/h2&gt;

&lt;p&gt;The "Crawled – currently not indexed" list was mostly my Academy guides: 1,000–3,000-word articles. The prerendered HTML told a different story. The build step wrote a short summary into each page's static HTML, and the real article only appeared after JavaScript ran. To a crawler's first fetch, my longest guide was ~125 words.&lt;/p&gt;

&lt;p&gt;The fix was to server-render the actual React components at build time, inside the existing Vite plugin's &lt;code&gt;closeBundle&lt;/code&gt; hook:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;createServer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;configFile&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cwd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s2"&gt;"@"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;esbuild&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;jsx&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"automatic"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;appType&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"custom"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;middlewareMode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hmr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;ssr&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;resolve&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;externalConditions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"module-sync"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;mod&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;ssrLoadModule&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/src/ssr/articles.tsx"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// mod.renderArticleMain(route) -&amp;gt; renderToString(&amp;lt;MemoryRouter&amp;gt;…) -&amp;gt; &amp;lt;main&amp;gt;…&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two gotchas cost me most of the time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;react-router v7 under Node resolved to its CommonJS build&lt;/strong&gt;, so Vite's SSR loader couldn't see named exports like &lt;code&gt;MemoryRouter&lt;/code&gt;. Its package exports only point at the ESM build under the &lt;code&gt;module-sync&lt;/code&gt; condition, hence &lt;code&gt;externalConditions: ["module-sync"]&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;jsxDEV is not a function&lt;/code&gt;.&lt;/strong&gt; Loading the app's own Vite config in serve mode compiled JSX for React's dev runtime, while the build process runs with &lt;code&gt;NODE_ENV=production&lt;/code&gt;. A standalone config with esbuild's automatic JSX runtime fixed it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Any render error falls back to the old summary, so a broken article can never fail a deploy. The guides now ship 800–2,400 words of real HTML each.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The flash I introduced (and then fixed)
&lt;/h2&gt;

&lt;p&gt;The static HTML lives inside &lt;code&gt;#root&lt;/code&gt;, and &lt;code&gt;main.tsx&lt;/code&gt; clears it before React mounts. But the browser paints that static HTML first, so on every reload visitors saw a plain, differently styled page for a moment. Light-theme users got a dark page.&lt;/p&gt;

&lt;p&gt;Two lines in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; hide it for JavaScript-capable browsers, with a timeout in case the app never loads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;style&amp;gt;html&lt;/span&gt;&lt;span class="nc"&gt;.js-app&lt;/span&gt; &lt;span class="nn"&gt;#seo-prerender&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;visibility&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;hidden&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'js-app'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nb"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'seo-prerender'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;classList&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;remove&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'js-app'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Crawlers and no-JS visitors still get the full content. It's the same content React renders.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Every visitor downloaded an auth SDK
&lt;/h2&gt;

&lt;p&gt;A source-map breakdown of the main bundle showed the full Supabase client (auth, storage, realtime, postgrest) at the top. Public pages only use it to refresh game data, and they already render from bundled seed data through React Query's &lt;code&gt;initialData&lt;/code&gt;. So the public hooks now import the client on demand:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;getSupabase&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;clientPromise&lt;/span&gt; &lt;span class="o"&gt;??=&lt;/span&gt; &lt;span class="k"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"@/integrations/supabase/client"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;supabase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;clientPromise&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Main bundle: &lt;strong&gt;210 KB → 152 KB gzipped&lt;/strong&gt;. The client is now its own chunk that loads after the page is on screen.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Telling Bing the moment a deploy goes live
&lt;/h2&gt;

&lt;p&gt;Since Bing was already my biggest search source, I added IndexNow: a public key file, plus a GitHub Action that runs on Vercel's &lt;code&gt;deployment_status&lt;/code&gt; event for successful Production deploys. It reads the live sitemap and POSTs every URL to &lt;code&gt;api.indexnow.org&lt;/code&gt;. The first run got back &lt;code&gt;202 Accepted&lt;/code&gt; for all 60 URLs.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. The audit script that couldn't see 115 broken links
&lt;/h2&gt;

&lt;p&gt;The project has a small Python audit for titles, canonicals, JSON-LD and internal links. On Windows it reported thousands of errors, which made it useless, so nobody noticed it was wrong. It built routes with &lt;code&gt;str(path)&lt;/code&gt;, which gave backslashes on Windows, so every internal link looked broken. Switching to &lt;code&gt;.as_posix()&lt;/code&gt; (and reading files as UTF-8) brought it down to one real problem: every plant page linked to &lt;code&gt;/mutations/none&lt;/code&gt;, a page that doesn't exist. Fixed that, and the audit now passes with 0 errors across 549 pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd tell my past self
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read Search Console's "why not indexed" reasons before writing anything new.&lt;/strong&gt; "Discovered" and "Crawled – currently not indexed" are Google telling you about quality, not about crawling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Look at your raw HTML, not your rendered page.&lt;/strong&gt; &lt;code&gt;curl&lt;/code&gt; and a word count would have caught the 120-word articles months earlier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programmatic pages need programmatic uniqueness.&lt;/strong&gt; If the template is 80% of the page, the page probably shouldn't be in Google yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's too early for results, since Google takes weeks to re-crawl. I'll post an update with the indexing numbers once they move.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Disclosure: I worked through these fixes with an AI coding assistant (Claude), which also helped draft this post. I've checked every number here against Search Console, Analytics and the live site; code snippets are trimmed versions of what's in the repo.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>seo</category>
      <category>vite</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
