usebruno/bruno · error · Error

directory: path is null

Error message

directory: path is null

What it means

Error "directory: path is null" thrown in usebruno/bruno.

Source

Thrown at packages/bruno-cli/src/utils/filesystem.js:73

    });
  } catch (err) {
    return Promise.reject(err);
  }
};

const hasJsonExtension = (filename) => {
  if (!filename || typeof filename !== 'string') return false;
  return ['json'].some((ext) => filename.toLowerCase().endsWith(`.${ext}`));
};

const hasBruExtension = (filename) => {
  if (!filename || typeof filename !== 'string') return false;
  return ['bru'].some((ext) => filename.toLowerCase().endsWith(`.${ext}`));
};

const createDirectory = async (dir) => {
  if (!dir) {
    throw new Error(`directory: path is null`);
  }

  if (fs.existsSync(dir)) {
    throw new Error(`directory: ${dir} already exists`);
  }

  return fs.mkdirSync(dir);
};

const searchForFiles = (dir, extension) => {
  let results = [];
  const files = fs.readdirSync(dir);
  for (const file of files) {
    const filePath = path.join(dir, file);
    const stat = fs.statSync(filePath);
    if (stat.isDirectory()) {
      results = results.concat(searchForFiles(filePath, extension));
    } else if (path.extname(file) === extension) {

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pass a valid directory path string instead of null/undefined.
  2. Check the calling code supplies the path argument.

When it happens

Trigger: Thrown at packages/bruno-cli/src/utils/filesystem.js:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/5abeafc103b31af9. Report an issue: GitHub.