---
title: "Troubleshooting Common Issues"
description: "Fix common Nuxt Starter Kit problems: JavaScript heap out of memory during the build, PostgreSQL connection errors, NUXT_E8014 at startup and stale builds."
canonical_url: "https://nuxtstarterkit.com/docs/support/troubleshooting"
---

> Index of every page on this site: [llms.txt](https://nuxtstarterkit.com/llms.txt)

## 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](https://github.com/vitejs/vite/issues/2433).

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:

```bash
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:

1. **Check connection string format**:```bash
NUXT_PRIVATE_DATABASE_URL="postgresql://user:password@host:5432/dbname"
```
2. **Verify database is running**:```bash
psql $NUXT_PRIVATE_DATABASE_URL -c "SELECT version();"
```
3. **Check firewall rules**: Ensure your database accepts connections from your deployment
4. **SSL/TLS issues**: Some providers require SSL. Try adding `?sslmode=require` to 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](https://nuxtstarterkit.com/docs/getting-started/setup#setup-environment-variables) 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](https://nuxtstarterkit.com/docs/getting-started/upgrade-to-layer-architecture).

## Stale build or dependencies

If builds are failing or using stale code:

```bash
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:

1. **Check the location**: the layer must be a direct child of `apps/web/layers/` and contain a `nuxt.config.ts`
2. **Don't add extends**: layers in `apps/web/layers/` must not be listed in `extends`
3. **Regenerate types**: run `pnpm install` (it runs `nuxt 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](https://nuxtstarterkit.com/docs/images#allowed-file-types-and-size).

## 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](https://nuxtstarterkit.com/docs/security#rate-limiting).

## Better-auth session issues

If users are being logged out unexpectedly:

1. **Check NUXT_BETTER_AUTH_SECRET**: Must be at least 32 characters and must not change between deployments
2. **Verify NUXT_PUBLIC_BASE_URL**: Should match your actual domain
3. **Check database sessions**: Verify sessions table has entries

## Migration issues

If migrations fail:

1. **Check the connection**: drizzle-kit reads `NUXT_PRIVATE_DATABASE_URL` from `apps/web/.env`
2. **Check for schema drift**: `pnpm db:generate` should create no migration when your schema files match the migrations
3. **Apply SQL manually** as a last resort:

```bash
psql $NUXT_PRIVATE_DATABASE_URL < apps/web/layers/auth/server/db/migrations/XXXX.sql
```

## Type errors in development

If you're seeing TypeScript errors:

```bash
# Regenerate types (runs `nuxt prepare` in apps/web)
pnpm install

# Check all layers
pnpm typecheck
```

## Deployment fails

Common deployment issues:

1. **Missing environment variables**: The server refuses to start (`NUXT_E8014`). With Docker, set the values both as runtime variables and as build secrets
2. **Database migrations not run**: Run `pnpm db:migrate` after deployment
3. **Build timeout**: Increase timeout in your platform settings
4. **Dependency installation**: Try `pnpm install --frozen-lockfile`

## Getting Help

If you're still stuck:

1. Review the [GitHub issues](https://github.com/NuxtStarterKit/nuxtstarterkit/issues)
2. Contact support via email (available to customers)

## Sitemap

See the full [sitemap](https://nuxtstarterkit.com/sitemap.md) for all pages.
