facebook/docusaurus · error · Error

Blog feed XSLT file was found at path=${path.relative(proces

Error message

Blog feed XSLT file was found at path=${path.relative(process.cwd(), xsltAbsolutePath)}
But its expected co-located CSS file could not be found at path=${path.relative(process.cwd(), cssAbsolutePath)}
If you want to provide a custom XSLT file, you must provide a CSS file with the exact same name.

What it means

Thrown by getXsltFile when the XSLT file exists but its expected co-located CSS file (same basename, .css extension in the same directory) does not. The plugin requires both files to be provided together so the feed styling stays self-contained.

Source

Thrown at packages/docusaurus-plugin-content-blog/src/feed.ts:217

    : ((await getDataFilePath({filePath: xsltFilePath, contentPaths})) ??
      path.resolve(contentPaths.contentPath, xsltFilePath));

  if (!(await fs.pathExists(xsltAbsolutePath))) {
    throw new Error(
      logger.interpolate`Blog feed XSLT file not found at path=${path.relative(
        process.cwd(),
        xsltAbsolutePath,
      )}`,
    );
  }

  const parsedPath = path.parse(xsltAbsolutePath);
  const cssAbsolutePath = path.resolve(
    parsedPath.dir,
    `${parsedPath.name}.css`,
  );
  if (!(await fs.pathExists(cssAbsolutePath))) {
    throw new Error(
      logger.interpolate`Blog feed XSLT file was found at path=${path.relative(
        process.cwd(),
        xsltAbsolutePath,
      )}
But its expected co-located CSS file could not be found at path=${path.relative(
        process.cwd(),
        cssAbsolutePath,
      )}
If you want to provide a custom XSLT file, you must provide a CSS file with the exact same name.`,
    );
  }

  return {xsltAbsolutePath, cssAbsolutePath};
}

async function generateXsltFiles({
  xsltFilePath,
  generatePath,

View on GitHub (pinned to 3f483e80e3)

Solutions

  1. Create a CSS file with the exact same basename as the XSLT in the same directory.
  2. If you renamed the xslt, rename the css to match.
  3. Re-run the build to confirm both files are now found.

Example fix

# before: blog/rss.xslt exists, blog/rss.css missing
# after: also create blog/rss.css containing the feed styles
Defensive patterns

Strategy: validation

Validate before calling

import path from 'path';
import fs from 'fs-extra';
const {dir, name} = path.parse(xsltAbs);
const cssAbs = path.join(dir, `${name}.css`);
if (!(await fs.pathExists(cssAbs))) throw new Error(`Co-located CSS missing: ${cssAbs}`);

Prevention

When it happens

Trigger: You supply feedOptions.xslt pointing to foo.xslt, but foo.css does not sit next to it. fs.pathExists(cssAbsolutePath) returns false.

Common situations: Renamed the .xslt file and forgot to rename the .css, only committed the xslt, or split the files into different directories.

Related errors


AI-assisted analysis of facebook/docusaurus@3f483e80e3 (2026-08-12). Data as JSON: /api/errors/b6000c200a55c94e. Report an issue: GitHub.