Troubleshooting Deployments
Encountering deployment issues? Here are solutions to the most common problems.
Build Failures
"Module not found" Error
Symptom: Build fails with Cannot find module 'xyz'
Solution:
- Ensure the package is in
package.json
dependencies (not devDependencies) - Delete
node_modules
and reinstall:rm -rf node_modules package-lock.json npm install
- Commit updated
package-lock.json
- Redeploy
Build Command Fails
Symptom: npm run build
returns error
Solution:
- Test build locally first:
npm install npm run build
- Check that your
package.json
has abuild
script - Verify all build dependencies are listed
- Check build logs for specific error messages
Out of Memory Error
Symptom: Build fails with "JavaScript heap out of memory"
Solution: Increase Node.js memory limit in your build command:
{
"scripts": {
"build": "NODE_OPTIONS='--max-old-space-size=4096' next build"
}
}
GitHub Connection Issues
"Failed to clone repository"
Symptom: Deployment fails at cloning stage
Solution:
- Check if Oblien has access to your repository
- Go to GitHub → Settings → Applications
- Ensure Oblien has repository access
- Try reconnecting your GitHub account
- Check if repository is private and access is granted
Webhook Not Triggering
Symptom: Auto-deploy doesn't work after push
Solution:
- Check repository webhook settings
- Go to Repository → Settings → Webhooks
- Verify Oblien webhook exists and is active
- Check recent deliveries for errors
- Try manual redeploy first
Runtime Errors
Application Won't Start
Symptom: Build succeeds but app doesn't start
Solution:
- Check your start command is correct
- Verify the port configuration (default: 3000)
- Ensure your app listens on
process.env.PORT
:const PORT = process.env.PORT || 3000; app.listen(PORT);
- Review application startup logs
404 on All Routes
Symptom: Deployment succeeds but all pages show 404
Solution:
For Static Sites:
- Verify output directory is correct
- Check build actually generated files
- Ensure
index.html
exists in output directory
For Server-Rendered Apps:
- Confirm server mode is selected (not static)
- Check start command is configured
- Verify application is listening on correct port
Missing Environment Variables
Symptom: App deployed but API calls fail
Solution:
- Environment variables feature coming soon
- For now, use build-time variables:
// Next.js NEXT_PUBLIC_API_URL=https://api.example.com npm run build
- Or hardcode production URLs temporarily
Performance Issues
Slow Build Times
Symptom: Builds take longer than expected
Solution:
- Remove unused dependencies
- Use cache-friendly package managers
- Optimize build configuration
- Consider build caching (coming soon)
Slow Application Response
Symptom: App is slow after deployment
Solution:
- Enable production mode in build
- Optimize bundle size
- Use CDN for static assets
- Check database/API response times
- Review application logs for bottlenecks
Framework-Specific Issues
Next.js
Issue: Static export not working
Solution:
- Ensure
next.config.js
has:module.exports = { output: 'export' };
- Set output directory to
out
instead of.next
- Don't use SSR/API routes with static export
Issue: Image optimization error
Solution:
For static exports, use unoptimized
:
// next.config.js
module.exports = {
images: {
unoptimized: true
}
};
React (Create React App)
Issue: Environment variables not working
Solution:
Use REACT_APP_
prefix:
// Works
const API_URL = process.env.REACT_APP_API_URL;
// Doesn't work
const API_URL = process.env.API_URL;
Vue/Vite
Issue: Import paths broken in production
Solution:
Set correct base path in vite.config.js
:
export default {
base: '/'
};
Checking Deployment Status
Real-Time Build Logs
Watch your deployment progress:
- Navigate to build page
- View live streaming logs
- Check for errors or warnings
- Note where build fails
Build History
Review previous deployments:
- Go to your project
- Click Builds or History
- Compare successful vs failed builds
- Check what changed between them
Common Error Messages
"Port already in use"
Solution:
Ensure your app uses process.env.PORT
:
const port = process.env.PORT || 3000;
"Permission denied"
Solution:
- Don't use ports below 1024
- Ensure file permissions are correct
- Check build scripts don't require sudo
"Build timed out"
Solution:
- Optimize build process
- Remove unnecessary build steps
- Contact support for timeout increases
Still Having Issues?
If you've tried the above solutions and still have problems:
1. Check Build Logs
The logs usually contain the exact error message and stack trace.
2. Test Locally
Run the exact same commands locally:
npm install
npm run build
npm start
3. Search Documentation
Check related docs:
4. Common Scenarios
Scenario | Most Likely Cause | Solution |
---|---|---|
Build fails immediately | Missing dependencies | Check package.json |
Build fails halfway | Out of memory | Increase memory limit |
Build succeeds, app fails | Wrong start command | Update configuration |
404 on all pages | Wrong output directory | Verify framework settings |
GitHub sync fails | Missing permissions | Reconnect GitHub |
5. Contact Support
Still stuck? Reach out with:
- Deployment ID or URL
- Build logs (copy/paste error messages)
- Steps you've already tried
- Your framework and version
Prevention Tips
Avoid common issues by:
- Testing locally first - Always build locally before deploying
- Using .gitignore - Don't commit build artifacts
- Keeping dependencies updated - Regular
npm update
- Following best practices - See our Best Practices guide
- Monitoring builds - Watch logs for warnings
Quick Debugging Commands
# Test build locally
npm run build
# Check for missing dependencies
npm ls
# Verify Node.js version
node --version
# Check npm script
npm run
# Clear cache and reinstall
rm -rf node_modules package-lock.json && npm install
Related Resources
- Configuration Guide - Detailed configuration options
- Best Practices - Avoid common pitfalls
- Quick Start - Get started quickly