This guide helps you resolve common issues you might encounter when using Pika Framework.
Quick Diagnosis
Section titled “Quick Diagnosis”Check Your Environment
Section titled “Check Your Environment”First, verify your setup:
# Check Node.js version (should be 22+)node --version
# Check pnpm versionpnpm --version
# Check Pika CLI versionpika --version
# Check AWS CLI (if using AWS features)aws --versionCommon Error Patterns
Section titled “Common Error Patterns”- Installation Issues: Node.js version, pnpm installation, permissions
- Build Errors: TypeScript compilation, missing dependencies
- Deployment Issues: AWS credentials, CDK bootstrap, IAM permissions
- Runtime Errors: Environment variables, network connectivity, AWS service limits
Installation Issues
Section titled “Installation Issues”Node.js Version Problems
Section titled “Node.js Version Problems”Solution:
# Check current versionnode --version
# Update Node.js with Homebrewbrew upgrade node# Update Node.js with NodeSourcecurl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -sudo apt-get install -y nodejsDownload and install from nodejs.org
pnpm Installation Issues
Section titled “pnpm Installation Issues”Solution:
# Use the official installer (recommended)curl -fsSL https://get.pnpm.io/install.sh | sh -
# Verify installationpnpm --version# Install pnpm globally via npmnpm install -g pnpm
# Verify installationpnpm --versionBuild Issues
Section titled “Build Issues”TypeScript Compilation Errors
Section titled “TypeScript Compilation Errors”Solution:
# Run in root of project, removes all .turbo, node_modules, etc.pnpm run clean
# In root, install all depspnpm install
# In root, try to build everythingpnpm build
# In root, check typescript typespnpm run check-typesMissing Dependencies
Section titled “Missing Dependencies”Solution:
# Reinstall all dependenciespnpm install
# Clear pnpm cachepnpm store prune
# Check for workspace issuespnpm list --depth=0Build Script Failures
Section titled “Build Script Failures”Solution:
# Check build logs for specific errorspnpm build --verbose
# Check for environment-specific issuesecho $NODE_ENV# Try building individual packagescd apps/pika-chat && pnpm buildcd services/pika && pnpm buildDeployment Issues
Section titled “Deployment Issues”AWS Credentials Not Configured
Section titled “AWS Credentials Not Configured”Solution:
# Configure AWS CLIaws configure
# Verify credentialsaws sts get-caller-identity# Set environment variablesexport AWS_ACCESS_KEY_ID=your-access-keyexport AWS_SECRET_ACCESS_KEY=your-secret-keyexport AWS_DEFAULT_REGION=us-east-1CDK Bootstrap Required
Section titled “CDK Bootstrap Required”Solution:
# Bootstrap CDK in your account/regioncdk bootstrap
# Verify bootstrapaws cloudformation describe-stacks --stack-name CDKToolkitInsufficient IAM Permissions
Section titled “Insufficient IAM Permissions”Solution:
- Ensure your AWS user has the necessary permissions
- Use an IAM role with appropriate permissions
- Contact your AWS administrator for proper permissions
Required permissions:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": ["cloudformation:*", "s3:*", "lambda:*", "apigateway:*", "iam:*", "logs:*", "cloudwatch:*"], "Resource": "*" } ]}Domain Configuration Issues
Section titled “Domain Configuration Issues”Solution:
# Verify certificate existsaws acm list-certificates --region us-east-1
# Check certificate ARN format# Should be: arn:aws:acm:region:account:certificate/cert-id# Verify hosted zone existsaws route53 list-hosted-zonesVPC Configuration Issues
Section titled “VPC Configuration Issues”Solution:
# List VPCsaws ec2 describe-vpcs# List subnetsaws ec2 describe-subnets
# Verify subnet tagsaws ec2 describe-subnets --subnet-ids subnet-12345678Runtime Issues
Section titled “Runtime Issues”Frontend Not Loading
Section titled “Frontend Not Loading”Solution:
# Check if development server is runninglsof -i :3000
# Check for build errorscd apps/pika-chat && pnpm build# Check environment variablescat .env.local
# Check browser console for JavaScript errorsBackend Services Not Responding
Section titled “Backend Services Not Responding”Solution:
# Check if services are deployedaws cloudformation describe-stacks --stack-name mycompany-pika# Check Lambda function logsaws logs tail /aws/lambda/mycompany-pika-service --follow
# Check API Gateway logsaws logs tail /aws/apigateway/mycompany-api --followAuthentication Issues
Section titled “Authentication Issues”Solution:
# Check authentication provider configurationcat apps/pika-chat/src/lib/server/auth-provider/index.ts
# Check browser cookies and local storage# Clear browser cache and cookies if neededSync Issues
Section titled “Sync Issues”Sync Command Fails
Section titled “Sync Command Fails”Solution:
# Check internet connectionping github.com
# Use debug mode for more informationpika sync --debug# Check GitHub accesscurl -I https://github.com/rithum/pika
# Try with different branchpika sync --branch mainUnexpected File Overwrites
Section titled “Unexpected File Overwrites”Solution:
# Check sync configurationcat .pika-sync.json
# Add files to userProtectedAreas# Edit .pika-sync.json and add:"userProtectedAreas": ["my-custom-file.ts"]# Restore from git if availablegit checkout HEAD -- my-custom-file.tsMerge Conflicts
Section titled “Merge Conflicts”Solution:
# Review conflictspika sync --diff
# Resolve conflicts manually# Edit conflicted files and remove conflict markers# Or protect the file# Add to userProtectedAreas in .pika-sync.jsonDebugging Tools
Section titled “Debugging Tools”Enable Debug Logging
Section titled “Enable Debug Logging”# Enable debug mode for various commandspika sync --debugpnpm run dev -- --debugcdk deploy --debug
# Check environment variablesenv | grep -i pikaenv | grep -i awsLog Analysis
Section titled “Log Analysis”# View recent logsaws logs tail /aws/lambda/mycompany-pika-service --follow# Search for errorsaws logs filter-log-events \ --log-group-name /aws/lambda/mycompany-pika-service \ --filter-pattern "ERROR"# Export logs for analysisaws logs export-task \ --task-name "export-$(date +%s)" \ --log-group-name /aws/lambda/mycompany-pika-service \ --from 1640995200000 \ --to 1641081600000 \ --destination "mycompany-logs-bucket" \ --destination-prefix "logs/"Performance Monitoring
Section titled “Performance Monitoring”# Check Lambda function performanceaws cloudwatch get-metric-statistics \ --namespace AWS/Lambda \ --metric-name Duration \ --dimensions Name=FunctionName,Value=mycompany-pika-service \ --start-time 2024-01-01T00:00:00Z \ --end-time 2024-01-02T00:00:00Z \ --period 3600 \ --statistics Average,Maximum# Check API Gateway performanceaws cloudwatch get-metric-statistics \ --namespace AWS/ApiGateway \ --metric-name Count \ --dimensions Name=ApiName,Value=mycompany-api \ --start-time 2024-01-01T00:00:00Z \ --end-time 2024-01-02T00:00:00Z \ --period 3600 \ --statistics SumGetting Help
Section titled “Getting Help”Before Asking for Help
Section titled “Before Asking for Help”- Check this troubleshooting guide for your specific issue
- Search existing issues on the GitHub repository
- Check the documentation for your specific use case
- Try the solutions above for common issues
When Creating an Issue
Section titled “When Creating an Issue”Environment details:
- Operating system and version
- Node.js version
- pnpm version
- Pika CLI version
Error details:
- Exact error message
- Steps to reproduce
- Expected vs actual behavior
Debug information:
- Console output with
--debugflag - Relevant log files
- Configuration files (without sensitive data)
What you've tried:
- Solutions attempted
- Workarounds that work/don't work
Community Resources
Section titled “Community Resources”- GitHub Issues: https://github.com/rithum/pika/issues
- GitHub Discussions: https://github.com/rithum/pika/discussions
- Documentation: https://pika.tools
Still having issues? Create a detailed issue on GitHub with all the information above, and the community will help you resolve it!