# Test individual article rendering
::render("vignettes/articles/my_article.Rmd")
rmarkdown
# Test full site build
::build_site()
pkgdown
# Check for external dependencies
::find_external_resources("vignettes/articles/my_article.Rmd") rmarkdown
Debugging Missing Pkgdown Articles
After a debugging session, I ask Claude Sonnet 4 to draft me a blog post in Quarto markdown format about how to find and troubleshoot the pkgdown/GitHub Actions issue I just experienced. I want that the blog plot covers:
- The problem I encountered
- The debugging process
- The root cause
- The solution
- Prevention tips
Below is the outcome.
The Problem
You’ve added new articles to your R package documentation, they render perfectly locally, but mysteriously disappear when deployed via GitHub Actions. The articles build successfully in CI, but result in 404 errors on your pkgdown website. Sound familiar?
This exact scenario recently happened while working on the drcHelper
R package, and the solution wasn’t immediately obvious.
Initial Symptoms
- ✅ Articles render locally with
pkgdown::build_site()
- ✅ GitHub Actions workflow completes successfully
- ✅ Build logs show articles being processed and written
- ❌ Articles return 404 errors on the live website
- ❌ Articles don’t appear in navigation menus
The Debugging Process
Step 1: Verify Local Rendering
First, always confirm the articles work locally:
Step 2: Examine GitHub Actions Logs
Look for these key indicators in your workflow logs:
# Successful article processing should show:
Reading vignettes/articles/my_article.Rmd
Writing `articles/my_article.html`
# Failed processing might show:
Error in vignettes/articles/my_article.Rmd:
[specific error message]
Step 3: Check Direct URL Access
Test if articles exist by accessing them directly:
https://your-username.github.io/your-package/articles/my_article.html
If this returns 404, the files aren’t being deployed correctly.
Step 4: Inspect Build Output Path
This is where the real issue was hiding! Look carefully at your build logs:
── Building pkgdown site for package drcHelper ─────────────────
Reading from: /home/runner/work/drcHelper/drcHelper
Writing to: /home/runner/work/drcHelper/drcHelper/docs/dev # 👈 Notice "dev"!
The Root Cause: Development Mode Path Mismatch
The issue was a subtle path mismatch caused by pkgdown’s development mode settings:
How Pkgdown Development Mode Works
Pkgdown has different deployment modes controlled by the development
section in _pkgdown.yml
:
development:
mode: auto # 👈 This was the culprit!
version_label: default
When mode: auto
, pkgdown determines the deployment path based on your package version: - Development versions (e.g., 1.0.0.9000) → builds to docs/dev/
- Release versions (e.g., 1.0.0) → builds to docs/
The Solutions
Option 1: Fix Development Mode (Recommended)
Change your development mode to ensure consistent paths:
development:
mode: release # Changed from 'auto' to 'release'
version_label: default
This builds everything to docs/
and makes your existing navigation URLs work correctly.
Verification Steps
After implementing the fix:
- Commit and push your
_pkgdown.yml
changes - Wait for GitHub Actions to complete
- Test article URLs directly in browser
- Check navigation menus work correctly
- Clear browser cache if needed
Prevention Tips
1. Understand Your Package Version
Check your package version in DESCRIPTION
:
# Development version (triggers dev mode)
: 1.0.0.9000
Version
# Release version (triggers release mode)
: 1.0.0 Version
2. Be Explicit with Development Mode
Instead of mode: auto
, explicitly set your preferred mode:
development:
mode: release # or 'devel' if you want dev/ paths
version_label: default
4. Monitor GitHub Actions Logs
Always check the “Writing to:” path in your build logs to ensure it matches your navigation expectations.
Debugging Checklist
When articles go missing, work through this checklist:
Key Takeaways
- Path consistency matters: Navigation URLs must match the actual build output paths
- Development mode is powerful but subtle:
mode: auto
can cause unexpected path changes - GitHub Actions success ≠ deployment success: Always verify the final result
- Read the logs carefully: The build output path is explicitly logged
- Test directly: Don’t rely solely on navigation menus for testing
Conclusion
This type of issue highlights why understanding the tools you use is crucial. Pkgdown’s development mode is a powerful feature for maintaining separate dev and release documentation, but it can cause subtle issues when not properly configured.
The lesson? When debugging complex deployment issues: 1. Start with the fundamentals (does it work locally?) 2. Examine the logs systematically 3. Test assumptions directly 4. Understand the tools’ behavior in different modes
Have you encountered similar deployment mysteries? The debugging process is often more valuable than the fix itself!
This post was inspired by a real debugging session while working on the drcHelper R package.