← Back to Blog

React vs Next.js: Why your AI-generated website is failing at SEO



React vs Next.js: Why your AI-generated website is failing at SEO

Tools like v0, Bolt.new, and Claude Artifacts are excellent for generating interface prototypes within seconds. However, if you deploy that generated code directly to production, you will likely encounter a frustrating issue down the line: Google will not index your pages properly.

Here is why client-side React breaks SEO for AI-generated websites, and how to resolve it quickly.

The Problem with Client-Side Rendering (CSR)

Most AI prompts produce single-page React applications (typically bundled with Vite or Create React App). These rely entirely on client-side rendering (CSR).

When Googlebot requests a CSR page, it receives an HTML shell:

<!DOCTYPE html>
<html>
 <head></head>
 <body>
 <div id="root"></div>
 <script src="/src/main.tsx"></script>
 </body>
</html>

Your copy, headers, images, and structured metadata are missing from that initial document. They only render after the JavaScript bundle downloads and executes within the browser.

Google can execute JavaScript, but it relies on a two-wave indexing model. It fetches the raw HTML first, places the JavaScript rendering into a secondary queue, and processes it when computing resources become available. In practice, this means your pages can remain unindexed or only partially indexed for weeks.

Quick Sanity Check: "View Page Source"

Open your site, right-click, and select View Page Source (not Inspect Element). If you do not see your page's actual text inside the HTML tags, search crawlers are not seeing it on their initial pass either.

Fix It: Move to SSR or Static Generation

To rank reliably, your server needs to deliver pre-rendered HTML containing your title tags, meta descriptions, and main content on the initial request.

Option 1: Next.js

If you want to maintain your React components as they are, migrate the project to Next.js. With App Router, components render on the server by default (SSR or SSG). Instead of serving an empty root div, your server delivers full HTML directly to Googlebot.

Option 2: Astro

For content-focused projects such as blogs, landing pages, or portfolios, Astro is usually a better fit than Next.js. It eliminates unused JavaScript by default, shipping plain HTML and CSS to the client. This provides near-perfect Core Web Vitals out of the box, which directly benefits your search rankings.

Quick 3-Step Migration Plan

1. Move components into Next.js or Astro: Copy your AI-generated React components into a Next.js App Router or Astro project structure. 2. Add dynamic metadata: Define page-specific </code> and <code><meta name="description"></code> tags using Next.js <code>generateMetadata</code> or Astro <code><head></code> props. 3. <strong>Submit an XML sitemap:</strong> Generate a <code>sitemap.xml</code> file and submit it via Google Search Console so crawlers can discover every route.</p> <p>---</p> <p>AI tools are incredible for prototyping UI, but they default to client-side setups that harm organic discovery. If inbound traffic matters for your application, package those components in a framework designed for rendering HTML on the server.</p> <p>Struggling to migrate your AI-generated React site to an SEO-friendly architecture? Book a free 15-minute infrastructure audit with me.</p> </article> </main></div><div class="newsletter-subscribe-box"><h3>Stay updated</h3><p>Get notified when I publish new deep-dives into DevOps, Cloud Architecture, and AI.</p><form><input type="email" placeholder="you@company.com" required="" value=""/><button type="submit">Subscribe</button></form></div></article></div></section></main><footer class="site-footer"><div class="footer-top"><div><a data-testid="link-footer-brand" href="/" class="brand"><img src="/portrait-96.webp" srcSet="/portrait-96.webp 1x, /portrait-192.webp 2x" class="brand-avatar" style="object-fit:cover" alt="Anas Rhimi" width="29" height="29"/><span>Anas Rhimi<span class="brand-dot">.</span>tech</span></a><p class="footer-note">Platform engineering for systems that matter.</p></div><div class="footer-columns"><div><span class="footer-label">Navigate</span><a data-testid="link-footer-about" href="/about">About</a><a data-testid="link-footer-services" href="/hire">Services</a><a data-testid="link-footer-projects" href="/projects">Projects</a><a data-testid="link-footer-blog" href="/blog">Writing</a><a data-testid="link-footer-pricing" href="/pricing">Pricing</a></div><div><span class="footer-label">Resources</span><a data-testid="link-footer-certifications" href="/certifications">Certifications</a><a data-testid="link-footer-calculator" href="/tools/n8n-savings-calculator">n8n Calculator</a></div><div><span class="footer-label">Connect</span><a href="mailto:contact@anasrhimi.tech" data-testid="link-footer-email">Email</a><a href="https://github.com/Mealiclay01" target="_blank" rel="noreferrer" data-testid="link-footer-github">GitHub</a><a href="https://www.linkedin.com/in/anas-rhimi/" target="_blank" rel="noreferrer" data-testid="link-footer-linkedin">LinkedIn</a></div><div><span class="footer-label">Legal</span><a data-testid="link-footer-privacy" href="/privacy">Privacy</a><a data-testid="link-footer-terms" href="/terms">Terms</a></div></div></div><div class="footer-bottom"><span>© <!-- -->2026<!-- --> <!-- -->Anas Rhimi<!-- -->. <!-- -->All rights reserved.</span><span>Remote · Worldwide</span></div></footer> </div> <script type="application/json" id="__POST_DATA__">{"id":12,"slug":"react-vs-nextjs-seo","title":"React vs Next.js: Why your AI-generated website is failing at SEO","date":"2025-04-02","tags":[],"excerpt":"Tools like v0, Bolt.new, and Claude Artifacts are excellent for generating interface prototypes within seconds. However, if you deploy that generated code…","content":"\u003cmain class=\"wrapper stack gap-8\" data-astro-cid-aid3sr62>\n \u003carticle style=\"max-width: 768px; margin: 0 auto; width: 100%;\" class=\"stack gap-10\">\n \n\n \u003chr style=\"border: none; border-top: 1px solid var(--gray-800); width: 100%; margin: 0;\">\n \u003cfigure style=\"margin: 2.5rem 0; width: 100%;\">\u003cimg fetchpriority=\"high\" decoding=\"async\" height=\"630\" width=\"1200\" src=\"/assets/og/react-vs-nextjs-seo.webp\" alt=\"React vs Next.js: Why your AI-generated website is failing at SEO\" style=\"width: 100%; border-radius: 16px; object-fit: cover; border: 1px solid var(--gray-800); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.7);\">\u003c/figure>\n\n \u003cdiv class=\"content\" style=\"color: var(--gray-200); line-height: 1.8; font-size: 1.1rem; width: 100%;\">\n\u003cp>Tools like v0, Bolt.new, and Claude Artifacts are excellent for generating interface prototypes within seconds. However, if you deploy that generated code directly to production, you will likely encounter a frustrating issue down the line: Google will not index your pages properly.\u003c/p>\n\u003cp>Here is why client-side React breaks SEO for AI-generated websites, and how to resolve it quickly.\u003c/p>\n\u003ch2>The Problem with Client-Side Rendering (CSR)\u003c/h2>\n\u003cp>Most AI prompts produce single-page React applications (typically bundled with Vite or Create React App). These rely entirely on client-side rendering (CSR).\u003c/p>\n\u003cp>When Googlebot requests a CSR page, it receives an HTML shell:\u003c/p>\n\u003cpre>\u003ccode class=\"language-html\"><!DOCTYPE html>\n<html>\n <head></head>\n <body>\n <div id=\"root\"></div>\n <script src=\"/src/main.tsx\"></script>\n </body>\n</html>\u003c/code>\u003c/pre>\n\u003cp>Your copy, headers, images, and structured metadata are missing from that initial document. They only render after the JavaScript bundle downloads and executes within the browser.\u003c/p>\n\u003cp>Google \u003cem>can\u003c/em> execute JavaScript, but it relies on a two-wave indexing model. It fetches the raw HTML first, places the JavaScript rendering into a secondary queue, and processes it when computing resources become available. In practice, this means your pages can remain unindexed or only partially indexed for weeks.\u003c/p>\n\u003ch3>Quick Sanity Check: \"View Page Source\"\u003c/h3>\n\u003cp>Open your site, right-click, and select \u003cstrong>View Page Source\u003c/strong> (not Inspect Element). If you do not see your page's actual text inside the HTML tags, search crawlers are not seeing it on their initial pass either.\u003c/p>\n\u003ch2>Fix It: Move to SSR or Static Generation\u003c/h2>\n\u003cp>To rank reliably, your server needs to deliver pre-rendered HTML containing your title tags, meta descriptions, and main content on the initial request.\u003c/p>\n\u003ch3>Option 1: Next.js\u003c/h3>\n\u003cp>If you want to maintain your React components as they are, migrate the project to Next.js. With App Router, components render on the server by default (SSR or SSG). Instead of serving an empty root \u003ccode>div\u003c/code>, your server delivers full HTML directly to Googlebot.\u003c/p>\n\u003ch3>Option 2: Astro\u003c/h3>\n\u003cp>For content-focused projects such as blogs, landing pages, or portfolios, Astro is usually a better fit than Next.js. It eliminates unused JavaScript by default, shipping plain HTML and CSS to the client. This provides near-perfect Core Web Vitals out of the box, which directly benefits your search rankings.\u003c/p>\n\u003ch2>Quick 3-Step Migration Plan\u003c/h2>\n\u003cp>1. \u003cstrong>Move components into Next.js or Astro:\u003c/strong> Copy your AI-generated React components into a Next.js App Router or Astro project structure.\n2. \u003cstrong>Add dynamic metadata:\u003c/strong> Define page-specific \u003ccode>\u003ctitle>\u003c/code> and \u003ccode>\u003cmeta name=\"description\">\u003c/code> tags using Next.js \u003ccode>generateMetadata\u003c/code> or Astro \u003ccode>\u003chead>\u003c/code> props.\n3. \u003cstrong>Submit an XML sitemap:\u003c/strong> Generate a \u003ccode>sitemap.xml\u003c/code> file and submit it via Google Search Console so crawlers can discover every route.\u003c/p>\n\u003cp>---\u003c/p>\n\u003cp>AI tools are incredible for prototyping UI, but they default to client-side setups that harm organic discovery. If inbound traffic matters for your application, package those components in a framework designed for rendering HTML on the server.\u003c/p>\n\u003cp>Struggling to migrate your AI-generated React site to an SEO-friendly architecture? Book a free 15-minute infrastructure audit with me.\u003c/p>\n\n\n\u003c/article>\n\u003c/main>"}</script> </body> </html>