Troubleshooting Common Issues
JavaScript heap out of memory error during build
The FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory error occurs when the Node.js process runs out of memory during build. This is related to this Vite issue.
The build script already sets an 8 GB heap. If your machine or build server has less memory and the build gets killed, build with a smaller heap:
NODE_OPTIONS=--max_old_space_size=3072 pnpm --filter web exec nuxt build
For CI/CD deployments, add this environment variable in your deployment platform's settings.
Database connection issues
If you're having trouble connecting to PostgreSQL:
- Check connection string format:
NUXT_PRIVATE_DATABASE_URL="postgresql://user:password@host:5432/dbname" - Verify database is running:
psql $NUXT_PRIVATE_DATABASE_URL -c "SELECT version();" - Check firewall rules: Ensure your database accepts connections from your deployment
- SSL/TLS issues: Some providers require SSL. Try adding
?sslmode=requireto your connection string
Server doesn't start: NUXT_E8014
The server checks the runtime config against the Zod schemas of the layers when it starts. Error NUXT_E8014 lists the required values that are missing. Set them in apps/web/.env (development) or in your deployment platform. See Setup for the required values.
If you upgraded from the Turborepo version: BETTER_AUTH_SECRET is now NUXT_BETTER_AUTH_SECRET, see Upgrade to the Layer Architecture.
Stale build or dependencies
If builds are failing or using stale code:
rm -rf node_modules apps/web/node_modules apps/web/.nuxt apps/web/.output
pnpm install
Layer not found
Nuxt registers every folder in apps/web/layers/ automatically:
- Check the location: the layer must be a direct child of
apps/web/layers/and contain anuxt.config.ts - Don't add
extends: layers inapps/web/layers/must not be listed inextends - Regenerate types: run
pnpm install(it runsnuxt prepare) after you add or delete a layer
Upload returns 415
The upload API checks the file content, not the file name or MIME type. Only PNG, JPEG, GIF, WebP, AVIF and PDF can be uploaded, and PDFs only when NUXT_PRIVATE_STORAGE_ALLOWED_MIME_TYPES includes application/pdf. See Images.
Requests return 429
Nuxt Security's rate limiter allows 150 requests per route and client IP within 5 minutes. Behind a proxy, all users may share the proxy's IP. See Security.
Better-auth session issues
If users are being logged out unexpectedly:
- Check NUXT_BETTER_AUTH_SECRET: Must be at least 32 characters and must not change between deployments
- Verify NUXT_PUBLIC_BASE_URL: Should match your actual domain
- Check database sessions: Verify sessions table has entries
Migration issues
If migrations fail:
- Check the connection: drizzle-kit reads
NUXT_PRIVATE_DATABASE_URLfromapps/web/.env - Check for schema drift:
pnpm db:generateshould create no migration when your schema files match the migrations - Apply SQL manually as a last resort:
psql $NUXT_PRIVATE_DATABASE_URL < apps/web/layers/auth/server/db/migrations/XXXX.sql
Type errors in development
If you're seeing TypeScript errors:
# Regenerate types (runs `nuxt prepare` in apps/web)
pnpm install
# Check all layers
pnpm typecheck
Deployment fails
Common deployment issues:
- Missing environment variables: The server refuses to start (
NUXT_E8014). With Docker, set the values both as runtime variables and as build secrets - Database migrations not run: Run
pnpm db:migrateafter deployment - Build timeout: Increase timeout in your platform settings
- Dependency installation: Try
pnpm install --frozen-lockfile
Getting Help
If you're still stuck:
- Review the GitHub issues
- Contact support via email (available to customers)
Help
Get help with Nuxt Starter Kit: ask the AI chat, join the private Discord for customers, use GitHub Discussions and Issues, or email me directly.
LLMs
Generate llms.txt and llms-full.txt with nuxt-llms so AI assistants can read your docs and blog posts, and extend both files with Nitro server plugins.