Troubleshooting
Common Issues and Troubleshooting
TL;DR (Top 10 Quick Reference)
- .env.local missing or DATABASE_URL not filled → Copy template and fill connection string
- Prisma generation failed → bunx prisma generate then init
- Port occupied → PORT=3001 bun dev
- Login 403/404 → Action prefix incorrect or role not bound to permission
- Menu not showing → Menu path doesn't match page route
- List empty → fieldsConfig key doesn't match database field
- Form fields not showing → Hidden/disabled or type not supported
- Batch operations invalid → Corresponding actions not provided or switch not enabled
- next build reports ESLint/TS → Fix type/syntax issues first
- External image 403 → Use regular img (this project already handles it)
Troubleshoot in order: startup → database → permissions → components → build, covering basic dependencies and environment variables first.
Startup Failure / Dependency Issues
- Confirm Node.js 20.9+, reinstall dependencies with
bun installorpnpm installusing local package manager. - Check if
.env.localexists and is read bybun run init; missingDATABASE_URLwill directly abort. - Port occupied: Default 3000, use
PORT=3001 bun devwhen conflicted. - macOS/Linux no execution permission: Add
chmod +x scripts/*.shto scripts.
Database / Prisma
- Connection error: Verify connection with
psql $DATABASE_URLorbun prisma db push, cloud databases need public access/whitelist. - Migration failed: Delete
.prismacache, re-runbun prisma generate, then executebun run init; if schema changed, clean history migrations or rebuild database first. - Seed data missing: Confirm
bun run initcompleted all 4 steps; if only want to import seeds, executebun run seed(need to generate Prisma Client first).
Login / Permissions / Menu
- Admin login redirect failed: Check
BETTER_AUTH_URLmatches actual access domain (including protocol port),BETTER_AUTH_SECRETat least 32 bytes. - 403/404: Confirm Action name prefix is
sys, and bind corresponding permissions and menus in roles; RBAC missing permissions will directly return 404. - Menu not showing:
menu.pathneeds to match actual page route; if external link or custom page, keep unique path and check associated permission code.
SmartCrudPage / SmartForm
- List empty or error:
keyinfieldsConfigmust match database field; functions likeactions.getListneed to be fully passed in. - Form fields not rendering: Check if
form.hidden/form.disabledis configured, or field type not supported (refer to/docs/api/FIELDS_CONFIG). - Batch operations/custom buttons invalid: Confirm corresponding handler functions provided in
actions, and enable switches likeenableBatchActionson component.
Build / Runtime
next builderror: Prioritize checking unresolved TypeScript/ESLint issues; MDX errors usually are incorrect import paths or unsupported syntax.- Static resources 404: Ensure files are in
public/and reference paths start with/; cloud storage settings need complete configuration in.env.local(see/docs/admin/guides/STORAGE). - i18n routing issues: Include locale in access path (e.g.,
/zh/admin), and check default language settings ini18n/config.
Still Not Resolved?
- Locate by module: Database related check
/docs/admin/database/PRISMA_GUIDE; permission issues combine/docs/architecture/PERMISSION_MODELwith/docs/admin/rbac/CONFIGURATION. - When submitting Issue, include: execution command, complete terminal error, key
.env.localconfiguration (masked), Prisma version and database type.