<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>nextjs - Build and Bail</title>
	<atom:link href="https://buildandbail.com/tag/nextjs/feed/" rel="self" type="application/rss+xml" />
	<link>https://buildandbail.com</link>
	<description>Build. Validate. Bail. Repeat.</description>
	<lastBuildDate>Thu, 16 Apr 2026 12:11:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://buildandbail.com/wp-content/uploads/2026/02/cropped-build-and-bail-icon-4-32x32.png</url>
	<title>nextjs - Build and Bail</title>
	<link>https://buildandbail.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>I built a content calendar app. Shipping it took three days.</title>
		<link>https://buildandbail.com/content-calendar-cloudflare-pages-deploy-nightmare/</link>
					<comments>https://buildandbail.com/content-calendar-cloudflare-pages-deploy-nightmare/#respond</comments>
		
		<dc:creator><![CDATA[CT]]></dc:creator>
		<pubDate>Thu, 16 Apr 2026 12:11:48 +0000</pubDate>
				<category><![CDATA[Build Logs]]></category>
		<category><![CDATA[build-log]]></category>
		<category><![CDATA[cloudflare-pages]]></category>
		<category><![CDATA[deploy-fails]]></category>
		<category><![CDATA[nextjs]]></category>
		<category><![CDATA[supabase]]></category>
		<guid isPermaLink="false">https://buildandbail.com/?p=1781</guid>

					<description><![CDATA[The app itself was the easy part. Next.js 14, Supabase auth, Tailwind, a calendar view for scheduling Build and Bail posts across TikTok, Shorts, Reels, Reddit, and the blog. Standard stuff. Claude Code knocked that out before I even got seriously involved. Then I tried to deploy it to Cloudflare Pages. Three days, four separate [&#8230;]<p>Read more at <a href="https://buildandbail.com/content-calendar-cloudflare-pages-deploy-nightmare/">Build and Bail</a></p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The app itself was the easy part. Next.js 14, Supabase auth, Tailwind, a calendar view for scheduling Build and Bail posts across TikTok, Shorts, Reels, Reddit, and the blog. Standard stuff. Claude Code knocked that out before I even got seriously involved.</p>



<p class="wp-block-paragraph">Then I tried to deploy it to Cloudflare Pages.</p>



<p class="wp-block-paragraph">Three days, four separate problems, one leaked Supabase password. Here&#8217;s the autopsy.</p>



<h2 class="wp-block-heading">Problem 1: The login redirect loop</h2>



<p class="wp-block-paragraph">Signed in. Got bounced back to login. Signed in again. Bounced back again. Rinse and repeat until I started questioning my life choices.</p>



<p class="wp-block-paragraph">Cookie writes from server actions weren&#8217;t persisting on Cloudflare&#8217;s edge runtime. The fix:</p>



<ul class="wp-block-list">
<li>Move the sign-in call to a browser client</li>



<li>Use a hard <code>window.location.href</code> redirect after success</li>



<li>Stop trying to be clever with server actions for auth on the edge</li>
</ul>



<p class="wp-block-paragraph">Not elegant. Works.</p>



<h2 class="wp-block-heading">Problem 2: &#8220;Supabase env vars: (none found)&#8221;</h2>



<p class="wp-block-paragraph">I&#8217;d set the <code>NEXT_PUBLIC_*</code> variables as Secrets in the Cloudflare dashboard. Seemed reasonable. Secrets are for secret things, right?</p>



<p class="wp-block-paragraph">Wrong.</p>



<ul class="wp-block-list">
<li>Next.js inlines <code>NEXT_PUBLIC_*</code> vars at build time</li>



<li>Secrets in Cloudflare Pages aren&#8217;t exposed at build time</li>



<li>So every Supabase call crashed with undefined credentials</li>
</ul>



<p class="wp-block-paragraph">Fix was moving them into <code>wrangler.toml</code> under <code>[vars]</code> as plaintext. I added a note to <code>.env.example</code> so future me doesn&#8217;t do this again.</p>



<h2 class="wp-block-heading">Problem 3: 500s on every static chunk</h2>



<p class="wp-block-paragraph">This is where I burned most of the three days.</p>



<p class="wp-block-paragraph">Every JS and CSS file under <code>_next/static/*</code> was returning empty-body 500 errors. Build output looked fine. Logs were clean. Everything was correct. Except nothing worked.</p>



<p class="wp-block-paragraph">I went down a rabbit hole patching <code>_routes.json</code>, which produced a routing overlap error that ironically proved the routing was fine all along.</p>



<p class="wp-block-paragraph">Root cause: the Pages project itself had a corrupt asset bundle. Deleting and recreating the project fixed it in about 90 seconds.</p>



<p class="wp-block-paragraph">The signature to watch for, if anyone else hits this:</p>



<ul class="wp-block-list">
<li>Empty-body 500s on static assets</li>



<li><code>server: cloudflare</code> in response headers</li>



<li>No <code>cf-cache-status</code> header at all</li>



<li>Build log shows success</li>
</ul>



<p class="wp-block-paragraph">If you see all four, stop debugging the code. Delete the Pages project and start over.</p>



<h2 class="wp-block-heading">Problem 4: My Supabase password ended up in my browser history</h2>



<p class="wp-block-paragraph">At some point during all this, a form submission fell back to a GET request because the JS hadn&#8217;t loaded yet. My password got stuck in URL query strings. Which means it&#8217;s in my browser history. Which means it&#8217;s plausibly in Cloudflare&#8217;s edge logs too.</p>



<p class="wp-block-paragraph">I rotated the password. You should probably assume any credential that&#8217;s ever touched a form has leaked somewhere.</p>



<h2 class="wp-block-heading">What actually shipped</h2>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1020" height="975" src="https://buildandbail.com/wp-content/uploads/2026/04/image-3.png" alt="Content Calendar" class="wp-image-1783" title="I built a content calendar app. Shipping it took three days." srcset="https://buildandbail.com/wp-content/uploads/2026/04/image-3.png 1020w, https://buildandbail.com/wp-content/uploads/2026/04/image-3-300x287.png 300w, https://buildandbail.com/wp-content/uploads/2026/04/image-3-768x734.png 768w" sizes="(max-width: 1020px) 100vw, 1020px" /></figure>



<p class="wp-block-paragraph">A working content calendar with:</p>



<ul class="wp-block-list">
<li>Supabase auth that doesn&#8217;t loop</li>



<li>A weekly calendar view for scheduling across platforms</li>



<li>Status tracking (draft / scheduled / posted / flopped)</li>



<li>A quick-add modal so I can dump ideas when they hit</li>



<li>Hosted on Cloudflare Pages for free</li>
</ul>



<p class="wp-block-paragraph">The meta part: I built this specifically to schedule posts like this one. The first post on the calendar is a post about the calendar.</p>



<h2 class="wp-block-heading">Time breakdown</h2>



<ul class="wp-block-list">
<li>Actual building: ~30 minutes</li>



<li>Waiting for Cloudflare builds: a lot</li>



<li>Chasing the wrong theory on problem 3: at least an hour I&#8217;m not getting back</li>



<li>Total wall clock: 3 days</li>
</ul>



<h2 class="wp-block-heading">The real lesson</h2>



<p class="wp-block-paragraph">Deploys lie. When every layer says &#8220;success&#8221; but nothing works, the infrastructure itself might be broken in a way that doesn&#8217;t surface in logs. Recognize that pattern earlier next time.</p>



<p class="wp-block-paragraph">Also: I could have just used Notion. I know. I know.</p>



<p class="wp-block-paragraph"></p>
<p>Read more at <a href="https://buildandbail.com/content-calendar-cloudflare-pages-deploy-nightmare/">Build and Bail</a></p>]]></content:encoded>
					
					<wfw:commentRss>https://buildandbail.com/content-calendar-cloudflare-pages-deploy-nightmare/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: buildandbail.com @ 2026-08-21 05:25:50 by W3 Total Cache
-->