Troubleshooting
Common Issues
-
GitHub API Rate Limiting:
- Implement request queuing
- Use conditional requests with ETags
- Cache responses appropriately
-
Authentication Failures:
- Verify environment variables
- Check GitHub App configuration
- Validate JWT token expiration
-
Build Errors:
- Clear Next.js cache:
rm -rf .next - Verify TypeScript configuration
- Check package version compatibility
- Clear Next.js cache:
Debug Configuration
// next.config.js
const nextConfig = {
logging: {
fetches: {
fullUrl: true,
},
},
experimental: {
logging: {
level: "verbose",
},
},
};Environment Variables Validation
// Validate required environment variables at startup
const requiredEnvVars = [
"NEXT_PUBLIC_BACKEND_URL",
"NEXT_PUBLIC_BEARER_TOKEN",
"GITHUB_APP_ID",
"AUTH_SECRET",
];
requiredEnvVars.forEach((envVar) => {
if (!process.env[envVar]) {
throw new Error(`Missing required environment variable: ${envVar}`);
}
});Last updated on