Troubleshooting
Common issues and solutions when building portfolio documentation sites.
Setup issues
Python command not found
Problem: python: command not found or python3: command not found
Solutions:
-
Check if Python is installed:
-
Install Python:
- macOS:
brew install python3 - Ubuntu or Debian:
sudo apt-get install python3 -
Windows: Download from python.org
-
Use full path:
Virtual environment activation fails
Problem (Windows): cannot be loaded because running scripts is disabled
Solution:
# Run PowerShell as Administrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Problem (macOS or Linux): source: command not found
Solution:
# Use correct shell activation
source venv/bin/activate # bash or zsh
. venv/bin/activate # alternative
MkDocs not found after installation
Problem: mkdocs: command not found after pip install mkdocs
Solutions:
-
Verify virtual environment is activated:
-
Reinstall in active environment:
-
Check Python scripts directory in PATH:
Material theme not loading
Problem: Site displays but theme does not apply
Solutions:
-
Verify Material is installed:
-
Check
mkdocs.ymltheme configuration: -
Reinstall Material theme:
-
Clear MkDocs build cache:
MkDocs server issues
Port already in use
Problem: [Errno 48] Address already in use
Solutions:
-
Kill existing MkDocs processes:
-
Use different port:
-
Find and kill process using port:
Changes not appearing in browser
Problem: Edits not reflected when viewing local site
Solutions:
- Force refresh browser:
- Chrome or Firefox:
Ctrl+Shift+R(Windows or Linux) - Chrome or Firefox:
Cmd+Shift+R(macOS) -
Safari:
Cmd+Option+R -
Restart MkDocs server:
-
Clear browser cache completely
-
Check file was actually saved in editor
Build errors in terminal
Problem: mkdocs build or mkdocs serve shows errors
Common causes and solutions:
Broken link error:
Solution: Fix the link or create the missing fileYAML syntax error:
Solution: Check YAML indentation and syntax. Use YAML validator.Markdown parsing error:
Solution: Check for invalid Markdown syntax in the fileGitHub Pages deployment issues
gh-deploy command fails
Problem: mkdocs gh-deploy shows errors
Solutions:
-
Verify Git repository is initialized:
-
Check remote is configured:
-
Verify credentials:
-
Push access issues:
- Use personal access token instead of password
- Check repository permissions
- Verify you own the repository
Site not updating after deployment
Problem: Changes deployed but site shows old content
Solutions:
-
Wait 2-3 minutes for GitHub Pages to rebuild
-
Force refresh browser (clear cache):
-
Ctrl+Shift+RorCmd+Shift+R -
Check GitHub Actions:
- Go to repository Actions tab
- Look for "pages build and deployment" workflow
-
Check for errors
-
Verify
gh-pagesbranch updated: - Go to repository on GitHub
- Switch to
gh-pagesbranch -
Check commit timestamp
-
Clear DNS cache:
404 error on GitHub Pages
Problem: Site shows "404 There is not a GitHub Pages site here."
Solutions:
- Verify repository is public:
- Go to repository Settings
- Check visibility under "Danger Zone"
-
Change to Public if needed
-
Check GitHub Pages settings:
- Go to Settings → Pages
- Source should be "Deploy from a branch"
- Branch should be
gh-pages// (root) -
Click Save
-
Verify
gh-pagesbranch exists: -
Run deployment again:
Custom domain not working
Problem: Custom domain shows error or does not connect
Solutions:
-
Wait for DNS propagation (24-48 hours after setup)
-
Check DNS configuration:
-
Verify GitHub Pages custom domain setting:
- Go to Settings → Pages
- Custom domain field shows your domain
-
"Enforce HTTPS" should be enabled
-
Check domain registrar settings:
- A records point to GitHub Pages IPs
-
CNAME record for www points to username.github.io
-
Remove and re-add custom domain:
- Delete custom domain in GitHub settings
- Wait 5 minutes
- Add it back and save
AI and API issues
API rate limit exceeded
Problem: AI provider shows rate limit errors
Solutions:
- Wait for rate limit to reset:
- Check provider dashboard for reset time
-
Anthropic and OpenAI show limits in console
-
Reduce frequency of requests:
- Generate content section by section
- Save prompts and reuse outputs
-
Use smaller content chunks
-
Upgrade to paid tier:
- Free tiers have strict rate limits
- Paid tiers offer higher limits
Invalid API key error
Problem: 401 Unauthorized or Invalid API key
Solutions:
-
Check for extra spaces:
-
Verify correct provider:
- Anthropic keys start with
sk-ant- -
OpenAI keys start with
sk- -
Check key is active:
- Log into provider console
- Verify key has not been revoked
-
Check billing is set up
-
Regenerate key:
- Create new API key
- Update your
.envfile - Try again
AI generates incorrect technical information
Problem: AI output contains technical errors
Solutions:
This is expected behavior. Always:
- Verify technical accuracy manually
- Test all code examples
- Check API specifications
- Research unfamiliar concepts
- Consult official documentation
AI is a drafting tool requiring human verification.
AI output too generic or vague
Problem: Generated content lacks specific details
Solutions:
- Provide more detailed prompts:
- Include specific technical requirements
- Give concrete examples
-
Specify exact format needed
-
Generate section by section:
- Break documentation into smaller pieces
-
Provide detailed context for each section
-
Add specifics manually:
- Use AI for structure
- Add technical details yourself
- Incorporate domain knowledge
Content and writing issues
Documentation reads as AI-generated
Problem: Content feels generic or lacks authentic voice
Solutions:
- Edit heavily for voice:
- Remove generic phrases
- Add specific examples
- Include personality
-
Use authentic language
-
Add domain expertise:
- Include insider knowledge
- Reference real-world scenarios
- Explain trade-offs
-
Share experiences
-
Review and rewrite:
- Use AI as first draft only
- Rewrite in your own voice
- Add unique perspective
Code examples do not work
Problem: Code samples generate errors
Solutions:
- Test all examples:
- Run every code sample
- Fix syntax errors
- Verify imports
-
Check versions
-
Include necessary context:
-
Add error handling:
Navigation structure confusing
Problem: Site organization unclear or illogical
Solutions:
- Review information architecture:
- Group related content
- Use clear categories
-
Limit nesting depth (3 levels maximum)
-
Test with fresh eyes:
- Ask someone to review
- Observe where they get confused
-
Simplify structure
-
Add navigation aids:
- Breadcrumbs (enabled by default in Material)
- Cross-references between pages
- Clear page titles
Markdown formatting broken
Problem: Content does not display correctly
Common issues:
Headings not rendering:
Lists not formatting:
Bad:
-No space after dash
- Inconsistent indentation
- Two spaces
- Four spaces
Good:
- Space after dash
- Consistent indentation
- Two spaces for nesting
- Two more spaces
Code blocks not highlighting:
Links not working:
Performance and optimization issues
Site builds slowly
Problem: mkdocs build takes long time
Solutions:
- Remove large files from docs:
- Move images to external hosting
- Compress images before including
-
Limit PDF file sizes
-
Simplify navigation:
- Reduce number of pages
- Flatten deep nesting
-
Remove unused plugins
-
Use
.gitignoreto exclude build artifacts:
Site loads slowly
Problem: Pages take long time to display
Solutions:
- Optimize images:
- Compress images (use TinyPNG, ImageOptim)
- Use appropriate formats (WebP for modern browsers)
-
Limit image dimensions
-
Minimize custom CSS:
- Remove unused styles
- Avoid large font files
-
Use system fonts
-
Enable Material theme optimization:
Get help
If you are still stuck:
1. Check documentation
2. Search for similar issues
- MkDocs GitHub issues
- Material GitHub issues
- Stack Overflow with
mkdocstag
3. Ask for help
Create new issue with:
- Error message (full text)
- Steps to reproduce
- Your environment (OS, Python version, MkDocs version)
- Relevant configuration (with sensitive data removed)
Do not share: - API keys - Personal access tokens - Private repository details
Open an issue if you encounter problems not covered here.