Troubleshooting Guide
Troubleshooting Guide
Section titled “Troubleshooting Guide”This guide covers common issues you might encounter when working with the BigIssue documentation site and their solutions.
Development Issues
Section titled “Development Issues”Site Not Loading Locally
Section titled “Site Not Loading Locally”Problem: Running npm run dev but the site doesn’t load at http://localhost:4321
Solutions:
- Check if the port is already in use:
Terminal window lsof -i :4321 - Kill any processes using the port:
Terminal window kill -9 [PID] - Try running on a different port:
Terminal window npm run dev -- --port 4322
Build Failures
Section titled “Build Failures”Problem: npm run build fails with TypeScript errors
Solutions:
- Check TypeScript configuration:
Terminal window npx tsc --noEmit - Clear Astro cache:
Terminal window rm -rf node_modules/.astronpm run build - Reinstall dependencies:
Terminal window rm -rf node_modules package-lock.jsonnpm install
Deployment Issues
Section titled “Deployment Issues”CSS Not Loading on Deployed Site
Section titled “CSS Not Loading on Deployed Site”Problem: Local site looks perfect but deployed site appears unstyled
Common Causes:
- Asset path configuration issues
- Build output problems
- CDN caching issues
Solutions:
-
Check Build Output:
Terminal window npm run buildls -la dist/Verify CSS files are present in the
dist/directory. -
Clear Cloudflare Cache:
- Go to Cloudflare Dashboard
- Navigate to Caching → Purge Cache
- Select “Purge Everything”
-
Verify Asset Paths: Check
astro.config.mjsfor correctsiteconfiguration:export default defineConfig({site: 'https://your-actual-site.pages.dev',// Remove base path for Cloudflare Pages}); -
Use Wrangler for Direct Deployment:
Terminal window npm install wrangler@latest --save-devnpm run buildnpx wrangler pages deploy ./dist --project-name your-project
GitHub Actions Failing
Section titled “GitHub Actions Failing”Problem: Deployment workflow fails in GitHub Actions
Check These:
-
Secrets Configuration:
CLOUDFLARE_API_TOKEN: Valid API token with correct permissionsCLOUDFLARE_ACCOUNT_ID: 32-character hexadecimal IDCLOUDFLARE_PROJECT_NAME: Exact project name from Cloudflare Pages
-
Build Environment:
- Node.js version compatibility (check workflow uses Node 18+)
- Package-lock.json is committed and up to date
-
Common Error Messages:
“Invalid API token”:
- Regenerate API token with
Cloudflare Pages:Editpermissions - Update GitHub secret
“Project not found”:
- Verify project name matches exactly in Cloudflare Pages
- Check spelling and case sensitivity
- Regenerate API token with
Preview Deployments Not Working
Section titled “Preview Deployments Not Working”Problem: Pull requests don’t generate preview URLs
Solutions:
-
Check Workflow Permissions: Ensure workflow has these permissions:
permissions:contents: readdeployments: writepull-requests: write -
Verify Branch Configuration:
- PR must target
mainbranch - Feature branch should be pushed to origin
- PR must target
-
Check Action Logs:
- Review GitHub Actions tab for detailed error messages
- Look for Cloudflare API rate limiting issues
Content Issues
Section titled “Content Issues”Links Not Working
Section titled “Links Not Working”Problem: Internal links return 404 errors
Solutions:
-
Check File Paths:
- Ensure target files exist in
src/content/docs/ - Use correct relative paths or slugs
- Ensure target files exist in
-
Update Navigation: Add new pages to
astro.config.mjssidebar configuration:sidebar: [{label: 'Guide',items: [{ label: 'New Page', slug: 'new-page' },],},]
Images Not Displaying
Section titled “Images Not Displaying”Problem: Images show broken links or don’t load
Solutions:
-
Correct Image Paths:
- Place images in
src/assets/for processed images - Use
public/for static images that don’t need processing
- Place images in
-
Image Imports:
 -
Check File Extensions:
- Use web-compatible formats (PNG, JPG, WebP, SVG)
- Verify file names match exactly (case-sensitive)
Performance Issues
Section titled “Performance Issues”Slow Build Times
Section titled “Slow Build Times”Problem: npm run build takes too long
Solutions:
-
Enable Parallel Processing: Check if your system supports parallel builds and optimize accordingly.
-
Image Optimization:
- Compress large images before adding to repository
- Use appropriate formats (WebP for photos, SVG for icons)
-
Clear Build Cache:
Terminal window rm -rf node_modules/.astro dist/npm run build
Getting Help
Section titled “Getting Help”If you’re still experiencing issues:
- Check GitHub Discussions for community support
- Create an Issue using our bug report template
- Review Recent Changes that might have caused the problem
- Check Service Status:
Prevention Tips
Section titled “Prevention Tips”- Always test changes locally before pushing
- Use feature branches for all changes
- Keep dependencies updated regularly
- Monitor deployment logs for warnings
- Test on multiple devices and browsers