Common issues and fixes — GitHub adapter, content not showing, port conflicts, images, and more.
GitHub adapter: "Bad Token"
Cause: OAuth token expired or revoked.
Fix:
- Go to Sites → Settings → reconnect GitHub
- Use a fine-grained PAT with
contents: read/writefor long-term stability - For automation: use a GitHub App installation token
"Collection Not Found"
Cause: Collection name in cms.config.ts doesn't match content directory.
Fix: Names must be identical:
cms.config.ts: defineCollection({ name: 'posts' })
Directory: content/posts/Content not showing after save
Cause: Next.js static cache — pages built at deploy time aren't regenerated until next build.
Fix options:
- On-demand revalidation (recommended) — configure webhook in Site Settings → Revalidation
- Time-based revalidation — add
export const revalidate = 60;to pages - Rebuild on content change — Git webhook triggers deployment
Port already in use
# Find what's using the port
lsof -ti:3000
# Use a different port
npx cms dev --port 3001Images not loading in production
Cause: Missing remotePatterns in next.config.ts.
Fix:
// next.config.ts
images: {
remotePatterns: [
{ protocol: 'https', hostname: 'your-domain.com', pathname: '/uploads/**' },
],
}Supabase: "Could Not Find Table"
Cause: PostgREST hasn't refreshed its schema cache.
Fix:
- Restart the Supabase project
- Verify table exists:
SELECT * FROM information_schema.tables WHERE table_name = 'documents'; - Check that the
anonkey hasSELECTpermission
Storage adapter defaults to SQLite
If you forget to specify storage in cms.config.ts, it defaults to SQLite. This means:
- Admin UI writes to a SQLite database
build.tsreads fromcontent/JSON files- The two systems are disconnected
Fix: Always specify the adapter explicitly:
storage: {
adapter: 'filesystem',
filesystem: { contentDir: 'content' },
}