Troubleshooting
Common errors you may encounter when using Stati and how to fix them.
Error: stati.config.ts not found
Cause: Stati could not find a configuration file in the current directory.
Solution:
- Ensure
stati.config.ts(orstati.config.js) exists in your project root - Run commands from the project root directory
- If using a custom path, specify it with
--config:stati build --config ./config/stati.config.ts
Error: layout.eta not found
Cause: A page references a layout that doesn’t exist.
Solution:
- Check the
layoutfield in your page’s frontmatter - Ensure the layout file exists in
site/(e.g.,site/layout.eta) - Use paths relative to
site/without the.etaextension:layout: layoutorlayout: layouts/blog
Error: Template syntax error
Cause: Invalid Eta template syntax.
Solution:
- Check for unclosed tags:
<%must have matching%> - Use
<%~for unescaped output (HTML),<%=for escaped output - Avoid partial dynamic attributes (see Dynamic Attribute Values)
Build is slow
Cause: Full rebuilds on every change, or ISG cache may be corrupted.
Solution:
- ISG is enabled by default; if disabled, re-enable with
isg: { enabled: true }instati.config.ts - Use
stati devduring development for hot reload - Run
npm run cleanthenstati buildif cache is corrupted
SEO tags not appearing
Cause: Auto-injection disabled or manual generation not called.
Solution:
- Check
seo.autoInjectis not set tofalse - If using manual mode, add
<%~ stati.generateSEO() %>to your layout’s<head> - Ensure
site.baseUrlis set for canonical URLs
Cache hiccups or stale content
Cause: ISG cache is outdated or corrupted.
Solution:
- Run
npm run cleanto clear the.stati/directory anddist/folder - Run
stati build --cleanto force a full rebuild - Check your ISG TTL settings in
stati.config.ts
Templates not refreshing during development
Cause: The development server may not be detecting file changes correctly.
Solution:
- Ensure you’re running
stati devfrom your project root - Check that your editor is saving files (some editors have auto-save delays)
- Try restarting the development server
Markdown content not rendering
Cause: Markdown file may have invalid frontmatter or syntax issues.
Solution:
- Ensure frontmatter is valid YAML between
---delimiters - Check for unclosed code blocks or invalid Markdown syntax
- Verify the file has a
.mdextension - Check the
layoutfield points to an existing template
Error: Assets not loading
Cause: Static assets may not be copied or paths may be incorrect.
Solution:
- Ensure assets are in the
public/directory - Use absolute paths starting with
/(e.g.,/images/logo.png) - Run
stati buildto copy static assets todist/ - Check browser console for 404 errors
RSS feed not generating
Cause: RSS feeds are only generated during production builds, not in development mode.
Solution:
- Run
stati build(notstati dev) to generate the RSS feed - Ensure
rss.enabled: trueis set in yourstati.config.ts - Verify
site.baseUrlis configured (required for RSS URLs) - Check the
dist/directory for your configured feed file(s) (filename is set inrss.feeds[].filename)
Sitemap not generating
Cause: Sitemaps are only generated during production builds.
Solution:
- Run
stati build(notstati dev) to generate the sitemap - Enable sitemap in config:
sitemap: { enabled: true } - Ensure
site.baseUrlis set (required for absolute URLs) - Check
dist/sitemap.xmlexists after building
TypeScript bundles not appearing
Cause: TypeScript bundles may not be compiling or bundle patterns may not match your pages.
Solution:
- Ensure
typescript.enabled: truein your config - Verify your entry point exists at
src/main.ts(or configuredsrcDir) - Check the dev server console for TypeScript compilation errors
- If using
include/excludepatterns in bundles, verify they match your page URLs - Bundles are automatically injected when TypeScript is enabled
Navigation not showing pages
Cause: Navigation generation may have failed or pages are excluded.
Solution:
- Ensure pages have valid frontmatter with
titlefield - Check that pages don’t have
draft: true(unless using--include-drafts) - Verify markdown files have
.mdextension - Files/folders starting with
_are excluded from navigation - Check for frontmatter parsing errors in build output
Invalid characters in URLs
Cause: Stati preserves filenames exactly (no automatic slug transformation). Spaces, underscores, or special characters in filenames become URL characters.
Solution:
- Use lowercase letters, numbers, and hyphens only in filenames
- Replace spaces with hyphens:
my-post.mdnotmy post.md - Replace underscores with hyphens:
my-post.mdnotmy_post.md - Rename files with problematic characters before building
Build hooks failing
Cause:
Custom hook functions (beforeAll, afterAll, beforeRender, afterRender) are throwing errors.
Solution:
- Wrap hook logic in try-catch for graceful error handling
- Check the error message in console output for specific details
- Ensure async hooks return a Promise or use async/await properly
- Test hooks in isolation before integrating
// Example: Safe hook with error handling
hooks: {
beforeRender: async (ctx) => {
try {
await yourLogic();
} catch (error) {
console.error('Hook failed:', error);
// Decide: throw to stop build, or continue
}
}
}
Tailwind CSS not compiling in development
Cause: Tailwind watcher may not be started or is misconfigured.
Solution:
- Ensure
tailwindcssis installed locally:npm install -D tailwindcss - Use both flags:
stati dev --tailwind-input src/styles.css --tailwind-output dist/styles.css - Verify
tailwind.config.jsexists and has correct content paths - Add
--tailwind-verboseto see Tailwind output for debugging - Check that the input file path is correct
Partial interpolation in template attributes
Cause:
Eta templates don’t support mixing static and dynamic text within attribute values like class="bg-<%= color %>-500".
Solution:
-
Use template literals for the entire attribute value:
class="<%= `bg-${color}-500` %>" -
For multiple classes, use
stati.propValue():class="<%= stati.propValue('base-class', `hover:bg-${color}-300`, isActive && 'active') %>" -
See Dynamic Attribute Values for details
README.md appearing as a page
Cause:
Stati routes all .md files inside the site/ directory, including README.md files placed there.
Solution:
- Move the README outside the
site/directory (e.g., to project root)