Troubleshooting
Deployment Errors
Debugging platform-specific deployment and runtime errors in Manic.
Deployment Errors
TL;DR
Solutions for common deployment errors on Vercel, Cloudflare, Netlify, and other platforms.
Vercel Errors
Error: "Function cancelled"
Problem: Function took too long to respond.
Solution:
- Check for infinite loops
- Add timeout handling
- Use streaming for long responses
Error: "MAX_DURATION_EXCEEDED"
Solution:
// Add maxDuration to route
// If supported in your config
export const config = {
maxDuration: 10, // seconds
};Error: "Build failed"
Check:
- Ensure
bun buildworks locally - Check package.json scripts
- Verify node_modules in output
// package.json
{
"scripts": {
"build": "bun build",
"start": "bun start"
}
}Cloudflare Errors
Error: "Worker exceeded GC limit"
Solution:
- Reduce bundle size
- Delete unused variables
- Use streaming
Error: "Durable Object error"
Check:
- Durable Objects may not be supported
- Use standard Workers instead
Error: "cf-content-types-generator"
Solution:
# wrangler.toml
compatibility_date = "2024-01-01"Netlify Errors
Error: "Build command not found"
Solution:
# netlify.toml
[build]
command = "bun build"
publish = "dist"Error: "Function not found"
Solution:
[[redirects]]
from = "/*"
to = "/index.html"
status = 200Common Platform Errors
Error: "Process not defined"
Problem: Node.js APIs not available.
Solution:
- Use web-standard APIs
- Check environment variables differently
// ✗ Avoid direct access in shared code
// process.env.PORT
// ✓ Use getEnv helper (recommended)
import { getEnv } from 'manicjs/env';
getEnv('MANIC_PUBLIC_PORT');Error: "Module not found"
Check:
- Package is in dependencies (not devDependencies)
- Package has browser build
- Check bundle for the import
Debugging Deployment
Check Build Output
# Locally simulate build
bun build
# Check dist/ directory
ls -la dist/Test Production Build Locally
manic start
curl http://localhost:6070Environment Variables
Set in platform dashboard:
- Avoid committing
.env - Use platform's env var UI
Platform Checklist
Vercel
- bun in dependencies
- Build script in package.json
- Start script configured
- Environment variables set
Cloudflare
- wrangler.toml configured
- Bun target in config
- Workers compatible code
Netlify
- netlify.toml configured
- bun build command
- publish directory correct
Getting Help
If you encounter an error not listed:
- Check platform docs
- Search GitHub issues
- Create reproduction
Best Practices
Test production build locally before deploying.
Don't use Node.js APIs that aren't available on your platform.
Use environment variables for platform-specific configuration.
See also: