Skip to content

Troubleshooting

When something fails, start with the exact command output and identify which stage failed: dependency installation, Prisma generation/migration, Dashild scaffolding, or the Next.js dev server. These stages are separate; rerun only the step that needs attention rather than deleting generated files or the database.

Useful checks:

Terminal window
pnpm prisma generate
pnpm dashild doctor
pnpm dev

prisma generate refreshes the generated client and Dashild metadata after a schema change. dashild doctor checks resource and policy wiring without connecting to the database. pnpm dev starts the app so you can reproduce a runtime or browser problem.

Next 16 only allows localhost for dev assets and HMR by default. Open http://localhost:3000, not http://127.0.0.1:3000, or add the origin to next.config.ts:

const nextConfig: NextConfig = {
allowedDevOrigins: ["127.0.0.1", "localhost"],
};

The generated config already includes both.

init reads dashild-metadata.json, which the dashild Prisma generator writes. Run pnpm prisma generate before init. If the file lives outside the standard paths, pass it explicitly:

Terminal window
pnpm dashild init --auth better-auth --metadata prisma/generated/dashild/dashild-metadata.json

The switch needs both theme.toggle: true and a themeAction prop. The route generated by dashild init passes it; a hand-written route must do the same. See Customization.

Native bindings are compiled for the Node that runs the install script. With pnpm there is no bundled node-gyp, so the prebuild must match. Install with the Node that runs the app and set the target:

Terminal window
PATH="$(dirname "$(node -p process.execPath)"):$PATH" \
npm_config_target="$(node -p process.versions.node)" \
npm_config_arch="$(node -p process.arch)" \
pnpm install

The scaffolder does this for you. If you use a version manager, make sure it does not resolve a different Node inside node_modules.

BETTER_AUTH_URL must match the browser origin exactly, including the port:

Terminal window
BETTER_AUTH_URL="http://localhost:3000"

If you open the app from another host or port, update the variable and restart the dev server.

If you use lerd, check that the database service is running; idle suspension can stop it. lerd service start postgres or lerd service start mysql brings it back. For a hosted database, check DATABASE_URL and DIRECT_URL and whether the provider requires SSL.

--font-sans is self-referencing or undefined. Define a real stack in globals.css:

@theme inline {
--font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif;
}

Tailwind classes from the shell are missing

Section titled “Tailwind classes from the shell are missing”

Tailwind must scan the package build. Add the source to your global CSS:

@source "../../node_modules/@dashild/admin/dist";

Adjust the relative path if your CSS file is in a different folder.

src/lib/email.ts logs the email in development and throws in production until you configure a provider. Set RESEND_API_KEY and EMAIL_FROM (uncomment them in .env), or replace sendEmail with your own transport.

The policy entry is fail-closed. Check that the resource declares policy: { scope: ... }, that policies.ts has an entry for the model under resources, and that scope returns a where fragment instead of null. Run pnpm dashild doctor for the exact file and line.

doctor exits with code 1 when it finds no resources. Create one with pnpm dashild make:resource <Model> or point --dir at the right folder.