A comprehensive guide to resolving common setup, build, test, and deployment errors for the Soroban Cookbook documentation site.
Error: Error: The engine "node" appears to be incompatible with this module
Root Cause: Node.js version doesn't meet the minimum requirement (>=20.0)
Fix Steps:
# Check current version
node --version
# Install correct version using nvm
nvm install 20
nvm use 20
# Or download from nodejs.orgPrevention: Add .nvmrc file with 20 to enforce version consistency.
Error: bun: command not found or Bun installation failed
Root Cause: Bun package manager not installed or not in PATH
Fix Steps:
# Install Bun
curl -fsSL https://bun.sh/install | bash
# Restart terminal or reload PATH
source ~/.bashrc # or ~/.zshrc
# Verify installation
bun --versionPrevention: Include Bun setup in project README and CI/CD workflows.
Error: bun install failed or npm ERR! peer dep missing
Root Cause: Corrupted lockfile, network issues, or incompatible dependencies
Fix Steps:
# Clear cache and reinstall
cd documentation
rm -rf node_modules bun.lock
bun install --frozen-lockfile
# If still failing, try fresh install
rm -rf node_modules bun.lock package-lock.json
bun installPrevention: Always commit bun.lock file and use --frozen-lockfile in CI.
Error: fatal: not a git repository or submodule-related errors
Root Cause: Project uses submodules not properly initialized
Fix Steps:
git submodule update --init --recursive
git submodule syncPrevention: Document submodule requirements in setup guide.
Error: process.env.VARIABLE is undefined
Root Cause: Required environment variables not set
Fix Steps:
# Create .env file
cp .env.example .env
# Edit .env with required values
# Or set in shell
export VARIABLE_NAME=valuePrevention: Provide .env.example file and document required variables.
Error: TS2322: Type 'string' is not assignable to type 'number'
Root Cause: Type mismatches, missing type definitions, or incorrect imports
Fix Steps:
# Run typecheck to see detailed errors
cd documentation
bun run typecheck
# Fix specific type issues
# Common fixes:
# - Add proper type annotations
# - Import correct types
# - Use type assertions carefullyPrevention: Enable strict TypeScript mode and run typecheck in CI.
Error: ESLint found too many warnings (max: 0)
Root Cause: Code style violations, unused variables, or syntax issues
Fix Steps:
# Auto-fix where possible
cd documentation
bun run lint:fix
# Manual fixes for remaining issues
bun run lintPrevention: Configure editor to run ESLint on save and set up pre-commit hooks.
Error: Prettier check failed or Code style issues found
Root Cause: Code not following project's formatting standards
Fix Steps:
# Auto-format all files
cd documentation
bun run format
# Check specific files
bun run format:checkPrevention: Set up editor integrations and pre-commit hooks for Prettier.
Error: Build failed or Cannot read property 'map' of undefined
Root Cause: Invalid frontmatter, broken links, or plugin misconfiguration
Fix Steps:
# Clear build cache
cd documentation
bun run clear
# Rebuild
bun run build
# Check for specific errors in build output
# Common issues:
# - Missing required frontmatter fields
# - Invalid sidebar configuration
# - Broken internal linksPrevention: Validate frontmatter and links in CI, use Docusaurus's built-in link checking.
Error: Module not found: Can't resolve './image.png'
Root Cause: Incorrect asset paths or missing files in static/ directory
Fix Steps:
# Verify file exists in correct location
ls documentation/static/
# Fix import paths
# Use absolute paths from static/ directory
# Example: import image from '/image.png'Prevention: Use Docusaurus's static folder structure and document asset organization.
Error: Port 3000 is already in use
Root Cause: Previous dev server still running or another process using port
Fix Steps:
# Kill process on port 3000
lsof -ti:3000 | xargs kill -9 # macOS/Linux
# or
netstat -ano | findstr :3000 # Windows
# Or use different port
cd documentation
bun start -- --port 3001Prevention: Use .env file to configure default port and document port usage.
Error: Changes not reflecting in browser during development
Root Cause: File watcher issues, incorrect file extensions, or configuration problems
Fix Steps:
# Restart dev server
cd documentation
bun run clear
bun start
# Check file permissions
# Ensure files are writable by the dev processPrevention: Use proper file extensions (.mdx for React components) and avoid large node_modules in watch paths.
Error: MDX compilation failed or Unexpected JSX token
Root Cause: Invalid MDX syntax, missing imports, or component issues
Fix Steps:
# Check MDX syntax
# Ensure proper JSX closing tags
# Import required components at top of file
# Use proper frontmatter
# Example fix:
import React from 'react';
import Component from './Component';Prevention: Use MDX linting tools and validate syntax in CI.
Error: Styles not applying or CSS modules not working
Root Cause: Incorrect CSS imports, missing Tailwind configuration, or path issues
Fix Steps:
# Check CSS imports in custom CSS
# Verify Tailwind configuration
# Ensure proper CSS module usage
# Restart dev server after CSS changesPrevention: Document CSS architecture and use consistent styling patterns.
Error: Search functionality not working or index outdated
Root Cause: Search plugin misconfiguration or build issues
Fix Steps:
# Rebuild search index
cd documentation
bun run build
# Check search plugin configuration
# Verify docusaurus.config.ts search settingsPrevention: Configure search plugins properly and test search functionality regularly.
Error: Pages is not enabled for this repository or missing deployment workflow
Root Cause: GitHub Pages not configured, deployment workflow missing, or permissions insufficient
Fix Steps:
# In GitHub repository settings:
# 1. Go to Settings β Pages
# 2. Set Source to "GitHub Actions"
# 3. Go to Settings β Actions β General
# 4. Set "Workflow permissions" to "Read and write permissions"
# Create deploy.yml in .github/workflows/ if missing
# Reference DEPLOYMENT.md for complete setupPrevention: Document deployment setup requirements and validate in CI.
Error: Permission denied or Insufficient permissions
Root Cause: GitHub Actions workflow lacks necessary permissions
Fix Steps:
# In workflow file, add proper permissions:
permissions:
contents: read
pages: write
id-token: write
checks: write
pull-requests: writePrevention: Use minimal required permissions and document permission requirements.
Error: No build artifact found or index.html not found
Root Cause: Build process failed or artifact upload issues
Fix Steps:
# Verify build locally
cd documentation
bun run build
ls build/ # Should contain index.html
# Check CI build logs for specific errors
# Fix build issues and redeployPrevention: Add build verification steps in CI and validate artifact creation.
Error: Stale cache causing build failures or outdated dependencies
Root Cause: Cache key conflicts or corrupted cache
Fix Steps:
# In GitHub Actions, clear cache:
- name: Clear cache
run: |
echo "Clearing cache..."
rm -rf ~/.bun/install/cachePrevention: Use proper cache keys and implement cache invalidation strategy.
Error: Build works locally but fails in CI/CD
Root Cause: Environment differences, missing dependencies, or platform-specific issues
Fix Steps:
# Match CI environment locally
# Use same Node.js version
# Use same dependency versions
# Check for platform-specific code
# Debug with:
docker run -it ubuntu:latest # Match CI environmentPrevention: Use container-based development and document environment requirements.
Error: Pages returning 404 after deployment
Root Cause: Incorrect base URL configuration or routing issues
Fix Steps:
// In docusaurus.config.ts, set correct baseUrl:
const config = {
baseUrl: '/', // Current setting for custom domain
// For GitHub Pages: '/repository-name/'
};Prevention: Test deployment thoroughly and configure base URL correctly for each environment.
Error: Various JS errors in browser console
Root Cause: Client-side code issues, missing dependencies, or runtime errors
Fix Steps:
# Check browser console for specific errors
# Fix component issues
# Verify all imports are correct
# Test in different browsersPrevention: Use TypeScript for type safety and implement error boundaries.
Error: Pages taking too long to load
Root Cause: Large assets, unoptimized images, or inefficient code
Fix Steps:
# Analyze bundle size
cd documentation
bun run build
# Check build/ directory size
# Optimize images
# Use lazy loading
# Implement code splittingPrevention: Monitor bundle size, optimize assets, and use performance budgets.
Error: Search functionality broken after deployment
Root Cause: Search index not built or incorrect configuration
Fix Steps:
# Rebuild and redeploy
cd documentation
bun run build
# Check search plugin configuration
# Verify search files are deployedPrevention: Test search functionality in staging before production deployment.
Error: Layout broken on mobile devices
Root Cause: CSS not responsive or viewport configuration issues
Fix Steps:
/* Ensure proper viewport meta tag */
/* Use responsive design patterns */
/* Test on different screen sizes */Prevention: Use responsive design from start and test on multiple devices.
Error: JavaScript bundle too large (>1MB)
Root Cause: Unused dependencies, large libraries, or unoptimized code
Fix Steps:
# Analyze bundle
cd documentation
bun run build
# Use bundle analyzer
npm install --save-dev webpack-bundle-analyzer
# Configure in docusaurus.config.tsPrevention: Regular bundle analysis, dependency audits, and code splitting.
Error: Node.js process memory increasing continuously
Root Cause: Memory leaks in custom code or plugins
Fix Steps:
# Monitor memory usage
# Profile with Chrome DevTools
# Fix event listener cleanup
# Check for circular referencesPrevention: Proper cleanup in React components and regular performance monitoring.
Error: Build process taking too long (>5 minutes)
Root Cause: Inefficient build configuration or large asset processing
Fix Steps:
# Optimize build configuration
# Use build caching
# Parallelize build steps
# Optimize images and assetsPrevention: Implement build caching and optimize build configuration.
Error: GitHub Actions timing out after 30 minutes
Root Cause: Inefficient workflows or resource-intensive operations
Fix Steps:
# Optimize workflow steps
# Use caching effectively
# Parallelize independent jobs
# Break into smaller workflowsPrevention: Regular workflow optimization and monitoring of execution times.
Error: Poor SEO scores or accessibility violations
Root Cause: Missing meta tags, poor structure, or accessibility issues
Fix Steps:
# Run lighthouse audit
# Fix meta tags and descriptions
# Improve semantic HTML
# Add alt text to imagesPrevention: Regular accessibility audits and SEO optimization.
cd documentation
bun install --frozen-lockfile
bun start # Start dev server
bun run build # Build for production
bun run serve # Serve production build
bun run typecheck # Check TypeScript
bun run lint # Lint code
bun run format # Format code# Clear all caches
bun run clear
rm -rf node_modules bun.lock
bun install --frozen-lockfile
# Full CI simulation
bun run format:check && bun run lint && bun run typecheck && bun run build
# Check specific issues
bun run typecheck # TypeScript errors
bun run lint # Linting issues
bun run build # Build problems# Verify build artifact
ls documentation/build/
file documentation/build/index.html
# Test production build locally
bun run build && bun run serveIf you encounter issues not covered in this catalog:
- Check GitHub Issues: Search existing issues in the repository
- Review Logs: Check CI/CD workflow logs for detailed error messages
- Community Support: Join the Stellar Discord
- Documentation: Refer to Docusaurus Docs
- Create Issue: Open a new issue with detailed error logs and reproduction steps
To add new issues or improve existing solutions:
- Reproduce the issue locally
- Document clear, reproducible steps
- Verify solutions work across different environments
- Update this catalog with prevention tips
- Test solutions in CI/CD pipeline
Last Updated: 2026-04-26
Version: 1.0.0
Maintainers: Soroban Cookbook Team