<?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: Louis Viney</title>
    <description>The latest articles on DEV Community by Louis Viney (@louis_viney).</description>
    <link>https://dev.to/louis_viney</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3917041%2Fbc807962-75f1-4dbe-aa6f-421051203286.jpg</url>
      <title>DEV Community: Louis Viney</title>
      <link>https://dev.to/louis_viney</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/louis_viney"/>
    <language>en</language>
    <item>
      <title>Fixing SEO for a React SPA Marketplace on Firebase Hosting</title>
      <dc:creator>Louis Viney</dc:creator>
      <pubDate>Thu, 07 May 2026 04:56:38 +0000</pubDate>
      <link>https://dev.to/louis_viney/fixing-seo-for-a-react-spa-marketplace-on-firebase-hosting-1imm</link>
      <guid>https://dev.to/louis_viney/fixing-seo-for-a-react-spa-marketplace-on-firebase-hosting-1imm</guid>
      <description>&lt;p&gt;I recently ran into an SEO problem while building a marketplace for Ionic templates and UI kits.&lt;/p&gt;

&lt;p&gt;The stack looked reasonable at first:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;React 18&lt;/li&gt;
&lt;li&gt;React Router 7&lt;/li&gt;
&lt;li&gt;Vite&lt;/li&gt;
&lt;li&gt;Firebase Hosting&lt;/li&gt;
&lt;li&gt;Firestore&lt;/li&gt;
&lt;li&gt;react-snap for prerendering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The site worked perfectly for users but Google hated it and none of the pages were indexing.&lt;/p&gt;

&lt;p&gt;After digging into Search Console, page source output, and prerender behaviour, I discovered several compounding problems that are easy to miss when building modern SPA marketplaces.&lt;/p&gt;

&lt;p&gt;This post breaks down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what was failing&lt;/li&gt;
&lt;li&gt;why Google wasn’t indexing the site&lt;/li&gt;
&lt;li&gt;and the architecture I ended up using to fix it&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Initial Problem
&lt;/h2&gt;

&lt;p&gt;The homepage source initially looked something like this:&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;body&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The visible content existed only after hydration. Google &lt;em&gt;can&lt;/em&gt; render JavaScript, but relying entirely on client-side rendering creates several problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;slower indexing&lt;/li&gt;
&lt;li&gt;inconsistent crawling&lt;/li&gt;
&lt;li&gt;weak internal-link discovery&lt;/li&gt;
&lt;li&gt;poor crawl prioritisation on new domains&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This became especially painful for marketplace product pages. Google was discovering URLs but refusing to index them.&lt;/p&gt;

&lt;p&gt;Search Console showed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Discovered – currently not indexed"&lt;/li&gt;
&lt;li&gt;"Crawled – currently not indexed"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So that meant that the pages were technically reachable but Google didn’t think they were strong enough to index yet&lt;/p&gt;




&lt;h2&gt;
  
  
  The First Attempt: react-snap
&lt;/h2&gt;

&lt;p&gt;I added react-snap to prerender the site. At first this seemed to work. &lt;br&gt;
The homepage source now contained:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;headings&lt;/li&gt;
&lt;li&gt;intro copy&lt;/li&gt;
&lt;li&gt;category links&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But product pages still weren’t indexing. After deeper inspection, I found  that the product pages were never actually being prerendered.&lt;/p&gt;

&lt;p&gt;react-snap had:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;crawl: false&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;and no dynamic route list for:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;/template/:id&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So every product page URL returned the generic SPA shell with homepage metadata.&lt;/p&gt;

&lt;p&gt;Even worse, the product pages fetched data from Firestore but&lt;br&gt;
react-snap blocks third-party requests during prerender so product data never loaded during snapshot generation.&lt;/p&gt;

&lt;p&gt;The result was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;homepage title on every product page&lt;/li&gt;
&lt;li&gt;homepage meta description on every product page&lt;/li&gt;
&lt;li&gt;no product-specific canonical tags&lt;/li&gt;
&lt;li&gt;no product-specific OpenGraph tags&lt;/li&gt;
&lt;li&gt;weak semantic HTML&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From Google’s perspective, these pages looked like low-value duplicates.&lt;/p&gt;


&lt;h2&gt;
  
  
  Constraints of Firebase Hosting
&lt;/h2&gt;

&lt;p&gt;Firebase Hosting is static-only, that meant no runtime SSR, no server-side route generation and no server-rendered metadata.&lt;/p&gt;

&lt;p&gt;To achieve static hosting, fast global delivery with low infrastructure complexity, I leaned fully into build-time generation because migrating to a Node SSR architecture felt excessive.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Architecture That Worked
&lt;/h2&gt;

&lt;p&gt;The fix was to euery Firestore for all published products before every build and export them into a local JSON file &lt;code&gt;public/ssg-data.json&lt;/code&gt;. I then regenerated the sitemap.xml and prerender the route list to create a local source of truth available during prerendering.&lt;/p&gt;

&lt;p&gt;Now react-snap blocks Firestore requests but it does NOT block local file requests. Now during prerender, the pages fetched &lt;code&gt;/ssg-data.json&lt;/code&gt; which made the product data available allowing SEO metadata to be rendered statically and product links to exist in initial HTML.&lt;/p&gt;

&lt;p&gt;The next critical fix was generating dynamic routes automatically during prebuild:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;routes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;`/template/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These routes are injected into the react-snap include list and every published product page gets snapshotted during build. No more SPA shell for product URLs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Product-Specific SEO Metadata
&lt;/h2&gt;

&lt;p&gt;Once product data became available during prerender, every product page could generate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;unique 
&lt;/li&gt;
&lt;li&gt;unique meta description&lt;/li&gt;
&lt;li&gt;canonical URL&lt;/li&gt;
&lt;li&gt;OpenGraph tags&lt;/li&gt;
&lt;li&gt;Twitter tags&lt;/li&gt;
&lt;li&gt;Product JSON-LD&lt;/li&gt;
&lt;li&gt;Breadcrumb JSON-LD&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&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;title&amp;gt;&lt;/span&gt;
NovaClip - Short-Form Video App — Ionic React UI Kits
&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;instead of:&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;title&amp;gt;&lt;/span&gt;
Ionic Market — Premium Ionic Templates...
&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Final issue was the homepage and category pages initially did not contain direct product links in source HTML. Because Google relies heavily on &lt;code&gt;&amp;lt;a href="/template/..."&amp;gt;&lt;/code&gt; for discovery and crawl prioritisation, I added featured products on homepage, category product grids and related products on product pages.&lt;/p&gt;

&lt;p&gt;The build flow now looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
  → prebuild
      query Firestore
      export ssg-data.json
      regenerate sitemap.xml
      generate prerender routes
  → vite build
  → react-snap prerender
      pages fetch local SSG data
      product pages render full metadata
  → firebase deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important detail is that the prerender step no longer depends on Firestore.&lt;/p&gt;




&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After these fixes, the product pages now contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;real semantic HTML&lt;/li&gt;
&lt;li&gt;unique metadata&lt;/li&gt;
&lt;li&gt;canonical tags&lt;/li&gt;
&lt;li&gt;structured data&lt;/li&gt;
&lt;li&gt;related links&lt;/li&gt;
&lt;li&gt;product-specific OpenGraph tags&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And the sitemap now contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;canonical product URLs&lt;/li&gt;
&lt;li&gt;canonical category URLs&lt;/li&gt;
&lt;li&gt;no query-string filter pages&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most importantly, the product pages are now actual HTML documents and&lt;br&gt;
not generic SPA fallback pages.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I still like the React/Vite/Firebase Hosting stack but if you’re building a marketplace or SEO-heavy application, you need to think carefully about all these:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prerender coverage&lt;/li&gt;
&lt;li&gt;metadata generation timing&lt;/li&gt;
&lt;li&gt;internal linking&lt;/li&gt;
&lt;li&gt;dynamic route discovery&lt;/li&gt;
&lt;li&gt;build-time data availability&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Otherwise Google may crawl your pages while still seeing a generic application shell and that can quietly kill indexing. For anyone curious, the implementation is currently powering &lt;a href="https://ionicmarket.com" rel="noopener noreferrer"&gt;https://ionicmarket.com&lt;/a&gt; which is a marketplace for Ionic templates, UI kits, feature modules, and Capacitor plugins.&lt;/p&gt;

</description>
      <category>react</category>
      <category>ionic</category>
      <category>firebase</category>
      <category>seo</category>
    </item>
  </channel>
</rss>
