Guides
Troubleshooting
Solutions for common issues when working with Barodoc.
Troubleshooting
Common issues and their solutions.
Setup & Installation
Make sure barodoc.config.json exists in your project root (or the directory you’re running from).
# Verify the file exists
ls barodoc.config.json
# Or specify the config path explicitly
barodoc serve --config ./path/to/barodoc.config.jsonBarodoc requires Node.js 20 or later. Check your version:
node --versionIf you’re using a version manager, switch to Node 20+:
# nvm
nvm install 20
nvm use 20
# fnm
fnm use 20Use a different port:
barodoc serve --port 4322Or kill the process using the default port:
lsof -ti:4321 | xargs kill -9Content & Build
Pages must be listed in barodoc.config.json under navigation:
{
"navigation": [
{
"group": "Guides",
"pages": ["guides/my-new-page"]
}
]
}The page path should match the file path relative to your docs locale folder, without the extension. For example, docs/en/guides/my-new-page.mdx becomes "guides/my-new-page".
Make sure you’re importing the component at the top of your MDX file:
import { Callout, Card } from "@barodoc/theme-docs";
<Callout type="tip">
This will render correctly.
</Callout>Warning
MDX files must use .mdx extension (not .md) to use components.
If you’re in Full Custom Mode (with astro.config.mjs), make sure your content collections are defined in src/content/config.ts:
import { defineCollection, z } from "astro:content";
const docsCollection = defineCollection({
type: "content",
schema: z.object({
title: z.string(),
description: z.string().optional(),
}),
});
export const collections = { docs: docsCollection };In Quick Mode, this is handled automatically.
Static assets should be placed in the public/ directory:
my-docs/
├── public/
│ └── images/
│ └── screenshot.png ← here
└── docs/
└── en/
└── guide.mdx ← references /images/screenshot.pngReference them with absolute paths:
i18n
Ensure your folder structure matches the configured locales:
{
"i18n": {
"defaultLocale": "en",
"locales": ["en", "ko"]
}
}Each locale needs its own directory with matching file paths:
docs/
├── en/
│ └── guides/setup.mdx
└── ko/
└── guides/setup.mdx ← same path structureThe language switcher only appears when more than one locale is configured in barodoc.config.json. Make sure locales has at least two entries.
Plugins
Search is powered by Pagefind, which indexes your site during the build step. Make sure you:
- Run a full build:
barodoc build - Preview the build:
barodoc preview
Search won’t work in dev mode — it only works on built output.
Check your plugin configuration:
{
"plugins": [
["@barodoc/plugin-openapi", {
"specFile": "openapi.yaml",
"basePath": "api"
}]
]
}The specFile path is relative to your project root. Verify the file exists and is valid YAML/JSON.
Ensure you’ve provided the correct tracking ID for your provider:
{
"plugins": [
["@barodoc/plugin-analytics", {
"google": { "measurementId": "G-XXXXXXXXXX" },
"plausible": { "domain": "docs.example.com" }
}]
]
}Analytics scripts are only injected in production builds, not during development.
Deployment
If your docs are hosted at a subpath (e.g., username.github.io/my-docs/), set the base option:
{
"base": "/my-docs"
}Without this, asset paths will resolve incorrectly.
Barodoc generates static HTML files. Configure your hosting provider to serve index.html for directory routes:
- Netlify: Add
_redirectsfile with/* /index.html 200 - Vercel: Works automatically
- GitHub Pages: Works automatically for static files
Still stuck?
If your issue isn’t covered here:
- Run
barodoc checkto validate your project - Check the GitHub Issues for similar reports
- Open a new issue with your error message and config