Troubleshooting
Solutions for common issues when developing with the NaaP platform.
Quick Diagnostics#
Run these commands to quickly identify issues:
Startup Failures#
Base Service Won't Start#
Symptom: base-svc failed to start on port 4000
Common causes:
- Database not running:
- Port 4000 already in use:
- Missing .env file:
Shell Won't Start#
Symptom: Shell failed to start on port 3000
- Missing .env.local:
- Port 3000 in use:
- Node modules corrupted:
Plugin Not Loading in Browser#
Symptom: Plugin shows as grey/disabled or errors in console
- Check CDN bundle exists:
- Rebuild the plugin:
- Check plugin is registered:
Database Issues#
Connection Refused#
Symptom: ECONNREFUSED 127.0.0.1:5432
Schema Missing Tables#
Symptom: validate shows schema exists but no tables
Prisma Client Not Generated#
Symptom: Cannot find module './generated/client/index.js'
Build Issues#
Plugin Build Fails#
TypeScript Errors#
Network/Port Issues#
Default Port Assignments#
| Service | Port |
|---|---|
| Next.js Shell | 3000 |
| Plugin Server | 3100 |
| Base Service | 4000 |
| Gateway Manager | 4001 |
| Orchestrator Manager | 4002 |
| Capacity Planner | 4003 |
| Network Analytics | 4004 |
| Marketplace | 4005 |
| Community | 4006 |
| My Wallet | 4007 |
| My Dashboard | 4008 |
| Daydream Video | 4010 |
| Developer API | 4011 |
| Plugin Publisher | 4012 |
| PostgreSQL | 5432 |
Kill All NaaP Processes#
Environment Issues#
Missing .env Files After Clone#
The .env files are gitignored for security. They're auto-created by:
Wrong Database URL in .env#
Performance#
Slow Next.js Startup#
First startup compiles all pages. Subsequent starts are faster due to .next cache.
Slow Plugin Builds#
Vercel Deployment Issues#
Plugin API Calls Timeout on Vercel#
Symptom: GET https://naap-....vercel.app:4006/api/v1/community/posts net::ERR_TIMED_OUT
Cause: Hardcoded localhost:PORT or window.location.hostname + ':PORT' in frontend code. On Vercel, there are no backend microservices — only the Next.js API proxy on port 443.
Fix: Use getPluginBackendUrl() from @naap/plugin-sdk:
| 1 | // WRONG |
| 2 | const API_BASE = 'http://localhost:4006/api/v1/community'; |
| 3 | const API_BASE = `${window.location.hostname}:4006/api/v1/community`; |
| 4 | |
| 5 | // CORRECT |
| 6 | import { getPluginBackendUrl } from '@naap/plugin-sdk'; |
| 7 | const API_BASE = getPluginBackendUrl('community', { |
| 8 | apiPath: '/api/v1/community', |
| 9 | }); |
Search your plugin for hardcoded ports:
Cannot Find Module 'tailwindcss' on Vercel#
Symptom: Loading PostCSS Plugin failed: Cannot find module 'tailwindcss'
Cause: A postcss.config.js exists in your plugin's frontend/ directory. On Vercel, PostCSS tries to require('tailwindcss') from the plugin directory, where hoisted dependencies aren't reachable.
Fix: Delete your plugin's postcss.config.js. PostCSS is configured centrally in @naap/plugin-build's shared Vite config:
Vercel buildCommand Too Long#
Symptom: buildCommand should NOT be longer than 256 characters
Cause: Complex multi-step build commands in vercel.json.
Fix: Use bin/vercel-build.sh as the build command. All build steps are in this script.
Prisma Query Engine Not Found on Vercel#
Symptom: Prisma Client could not locate the Query Engine for runtime "rhel-openssl-3.0.x"
Fix: Ensure next.config.js includes:
| 1 | const { PrismaPlugin } = require('@prisma/nextjs-monorepo-workaround-plugin'); |
| 2 | |
| 3 | module.exports = { |
| 4 | output: 'standalone', |
| 5 | outputFileTracingRoot: path.join(__dirname, '../../'), |
| 6 | webpack: (config) => { |
| 7 | config.plugins.push(new PrismaPlugin()); |
| 8 | return config; |
| 9 | }, |
| 10 | }; |
JSDoc Comment Breaks esbuild#
Symptom: Expected ";" but found "some_word" during npx tsx execution
Cause: A JSDoc comment contains */ (e.g., in a glob path like plugins/*/plugin.json), which prematurely closes the comment block.
Fix: Avoid */ in comments. Use {name} or spell it out:
| 1 | // WRONG — the */ closes the comment! |
| 2 | /** Discovers plugins from plugins/*/plugin.json */ |
| 3 | |
| 4 | // CORRECT |
| 5 | /** Discovers plugins from plugins/{name}/plugin.json */ |
Getting Help#
- Run
./bin/start.sh validatefor a comprehensive health check - Check logs:
./bin/start.sh logs <service> - Check the Architecture docs for understanding
- File an issue on GitHub