Troubleshooting
Common errors you may encounter when using Stati and how to fix them.
Site uses the default title or localhost URLs
Cause:
Stati did not use your configuration. Without a stati.config.ts, stati.config.js or stati.config.mjs in the current directory, Stati silently uses its defaults (site title “My Stati Site”, base URL http://localhost:3000). If the file exists but fails to load, the build prints the error followed by “Falling back to default configuration.” and continues with the defaults. Validation errors are different: a top-level option Stati does not know (such as Stati 1’s eta), helpers that are not functions, an outDir that is the project folder or overlaps srcDir, staticDir, typescript.srcDir or .stati, and invalid isg, images, readingTime, seo.twitter, seo.articles, seo.defaultAuthor.twitter, sitemap.news or css settings stop the build with an error that names the setting.
Solution:
- Run commands from the project root, where the config file is
- Read the start of the build output for “Error loading config” and fix the reported error
- A
.jsconfig that usesimportloads anyway, but Node prints a warning unlesspackage.jsonhas"type": "module", and the config fails to load if it says"type": "commonjs". Add"type": "module"or rename the file to.mjs
Page renders with the wrong layout or no styling
Cause:
A layout named in front matter that names no template logs a warning with similar names, and Stati falls back to the nearest layout.eta (or index.eta on index pages). If no layout exists at all, Stati logs “No layout template found, using fallback” and writes a bare HTML page.
Solution:
- Check the
layoutfield in your page’s front matter - Ensure the layout file exists in
site/(e.g.,site/layout.eta) - Name it the way template names work:
layout: postuses the nearestpost.etafrom the page’s folder up tosite/, andlayout: /layouts/blogusessite/layouts/blog.etaonly
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 - Write JavaScript only inside
<% %>: TypeScript annotations andascasts are syntax errors in templates - Read the data from
stati, not Eta’s defaultit
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 incremental rebuilds and live reload - Run
stati build --cleanif the 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 - Make sure the layout or shell has a
<head>element: auto-injection writes the tags before</head>, and the build warnsNo </head> tag found in <url>, so no SEO tags were added to itfor a page without one. A</head>in a comment or a script doesn’t count
Images look stretched or squashed
Cause:
Stati adds width and height to Markdown images. A stylesheet that sets max-width: 100% without height: auto narrows the image but keeps its full height.
Solution:
- Add
height: autonext tomax-widthin your image styles - Or turn the built-in image handling off with
images: false
Build stops with an image error
Cause:
images.responsive or images.og is on without @stati/images installed, the package doesn’t match your @stati/core version, or images.og has no public site.baseUrl.
Solution:
See Images troubleshooting for each message and its fix.
Cache hiccups or stale content
Cause:
ISG cache is outdated or corrupted, or a page shows data that Stati doesn’t track. Stati rebuilds a page when its own files change and when data it read changes: its collection or the navigation. Data that a helper collects in a beforeAll hook isn’t tracked, and neither is a change to a helper itself.
Solution:
- Read listings from
stati.collection, or, in thebeforeAllhook, write what a page shows into its front matter so it becomes part of the page’s hash - When a listing shows front matter beyond
title,description,tagsanddraft, add the fields tocollections.summaryFields - Run
stati build --cleanto cleardist/and.stati/and rebuild everything - Check your ISG TTL settings in
stati.config.ts
Pages that no longer exist are removed by every stati build, so stale HTML from a deleted or renamed page doesn’t need --clean.
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: The front matter may not start on the file’s first line, or the Markdown may have syntax issues.
Solution:
- Start the file with the opening
---line. With a blank line or other text before it, the front matter is read as Markdown and shows up in the page. (Front matter that is not valid YAML stops the build with the file and the line.) - Check for unclosed code blocks or invalid Markdown syntax
- Verify the file has a
.mdextension
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 paths from the site root (
/images/logo.png), and in templates write them asstati.url('/images/logo.png')so they also work when the site is served from a subfolder (see Deploying to a subfolder) - 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 (used for RSS URLs) - Check the build output for “RSS configuration validation failed”: any validation error stops all feeds
- Check the build output for “Failed to generate RSS feed”: a feed whose
filterorsortFnthrows is skipped, and the other feeds are still written - Check the
dist/directory for your configured feed file(s) (filename is set inrss.feeds[].filename)
RSS feed is empty
Cause:
contentPatterns and excludePatterns are matched against each page’s absolute source file path. A pattern such as 'blog/**' never matches.
Solution:
- Start folder patterns with
**/:contentPatterns: ['**/blog/**'] - Check that
excludePatternsandfilterdo not remove every page - Check the build output for warnings that name a page (“link mapping failed for page”): an item whose
linkfunction throws is skipped
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 - Check that
typescript.autoInjectis notfalse; with it off, add the script tags fromstati.assets.bundlePathsyourself
Navigation not showing pages
Cause: Navigation generation may have failed or pages are excluded.
Solution:
- Give pages a
titlein front matter; without one, the node is labeled with the file name - Check that pages don’t have
draft: true(unless using--include-drafts) - Verify markdown files have
.mdextension - Folders starting with
_are excluded from pages and navigation (individual files starting with_are not) - Remember that every folder of pages is a top-level node in
stati.nav.tree; nested folders are not inside their parent’schildren(see Navigation)
Invalid characters in URLs
Cause: Stati preserves filenames exactly (no automatic slug transformation). Spaces, underscores, or special characters in filenames become URL characters.
Solution:
- Name files with lowercase letters, digits and hyphens:
my-post.md, notmy post.mdormy_post.md
Build hooks failing
Cause:
Custom hook functions (beforeAll, afterAll, beforeRender, afterRender) are throwing errors.
Solution:
- Read the error in the build output. Stati doesn’t catch hook errors: a hook that throws stops the build, and
stati devshows the error in the error overlay - To add context, catch the error, log what the hook was doing and throw it again, so the build still stops:
hooks: {
beforeRender: async (ctx) => {
try {
await yourLogic();
} catch (error) {
console.error(`beforeRender failed for ${ctx.page.url}:`, error);
throw error;
}
},
}
Tailwind CSS not compiling in development
Cause: Tailwind watcher may not be started, may have stopped, or is misconfigured.
Solution:
- Ensure the Tailwind command is installed locally. Tailwind CSS 4, the version the scaffolder installs, ships it in
@tailwindcss/cli:npm install -D tailwindcss @tailwindcss/cli. With Tailwind CSS 3,npm install -D tailwindcss@3includes it - Use both flags:
stati dev --tailwind-input src/styles.css --tailwind-output dist/styles.css - Check where Tailwind looks for classes: the
@sourcerules in your stylesheet with Tailwind CSS 4, or thecontentpaths intailwind.config.jswith Tailwind CSS 3 - Add
--tailwind-verboseto see Tailwind output for debugging - Check that the input file path is correct
- If the dev server reported that the Tailwind CSS watcher stopped or exited, restart
stati dev. Tailwind CSS 4 exits when the stylesheet has an error at startup, so fix the error first
Dynamic Tailwind classes missing from the CSS
Cause:
Tailwind finds class names by scanning your files, so a class assembled at render time, such as class="bg-<%= color %>-500", is never seen.
Solution:
-
Build the classes with
stati.propValue(), which records every class it returns in.stati/tailwind-classes.htmlwhen Tailwind is detected:class="<%= stati.propValue('base-class', `bg-${color}-500`, isActive && 'active') %>" -
Make sure Tailwind scans
.stati/tailwind-classes.html(projects scaffolded with Tailwind already do). With Tailwind CSS 4, add@source '../.stati/tailwind-classes.html';tosrc/styles.css: Tailwind skips gitignored folders such as.stati/unless an@sourcerule names them. With Tailwind CSS 3, add./.stati/tailwind-classes.htmlto thecontentarray intailwind.config.js -
See Tailwind CSS integration and Dynamic attribute values for details
New sections unstyled after a deploy
Cause:
The stylesheet has the same URL in every deploy, such as /styles.css, and browsers that visited before still use their cached copy. Some hosts and CDNs cache CSS files for hours whatever the page’s own headers say, so new markup arrives with the old CSS.
Solution:
Production builds name stylesheets after their content, /_assets/styles-[hash].css, so each gets a new URL whenever it changes. A stylesheet still under a fixed name is one the build doesn’t see or can’t hash:
- A stylesheet that a script writes to
dist/afterstati build, such as abuild:cssscript. Build Tailwind withstati build --tailwind-input src/styles.css --tailwind-output dist/styles.css, and compile Sass intopublic/beforestati build. See Moving from abuild:cssscript css.hashset tofalseinstati.config- A stylesheet loaded some other way than a page’s
<link>, such as an@importin another stylesheet, or a path with characters other than letters, digits,-,_,.and/. Link it from the page, or rename it. See How pages link the hashed name
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)