2026-02-28
Better Changelog - FINALLY WORKING! π
Issues Fixed Tonight
- Missing
autoprefixerdependency - Next.js build failed - Missing marketing route pages - Created stub pages for /features, /pricing, /docs, /demo
- typedRoutes experiment too strict - Disabled (caused type errors on dynamic routes)
- Next.js CVE-2025-66478 - Upgraded to 16.1.6 (Vercel blocked vulnerable versions)
- Env vars with trailing newlines - Broke middleware domain comparison, re-added cleanly
- Clerk
auth.protect()incompatible with Next.js 16 - Changed to explicit redirect - Cookie write in server component -
setActiveTenantId()called ingetCurrentMember()threw error; removed (cookies can only be read in RSC, not written) - Missing database tables -
entry_audiencesandentry_product_areaswerenβt migrated to Neon DB
Root Cause Analysis
The main blocker was DB schema drift - the Drizzle schema defined junction tables that were never actually created in Neon. The query in getEntriesForDashboard() tried to join these tables and threw relation "entry_audiences" does not exist.
Debugging Approach
- Created
/api/healthendpoint to test auth chain step-by-step - Created
/dashboard/testminimal page to isolate which component failed - Found queries worked in API routes but crashed in server components
- Eventually traced to missing DB tables via health check error messages
Final State
- URL: https://changelog.someshovels.com β
- Sign-in/Sign-up: Working
- Dashboard: Working (shows empty entries, ready to create first changelog)
- Next.js version: 16.1.6
- Clerk version: 6.38.3
DB Tables Created
CREATE TABLE entry_audiences (
entry_id TEXT NOT NULL REFERENCES changelog_entries(id) ON DELETE CASCADE,
audience VARCHAR(50) NOT NULL,
PRIMARY KEY (entry_id, audience)
);
CREATE TABLE entry_product_areas (
entry_id TEXT NOT NULL REFERENCES changelog_entries(id) ON DELETE CASCADE,
product_area_id TEXT NOT NULL REFERENCES product_areas(id) ON DELETE CASCADE,
PRIMARY KEY (entry_id, product_area_id)
);Git Branch
All fixes on claude/changelog-saas-agent-profiles-4P7vs - needs PR to main