usebruno/bruno · error · Error
File ${filePath} is not a file
Error message
File ${filePath} is not a file What it means
Error "File ${filePath} is not a file" thrown in usebruno/bruno.
Source
Thrown at packages/bruno-cli/src/utils/filesystem.js:169
if (name.length > 255) return false; // max name length
if (reservedDeviceNames.test(name)) return false; // windows reserved names
return (
firstCharacter.test(name)
&& middleCharacters.test(name)
&& lastCharacter.test(name)
);
};
/**
* Checks if a file is larger than a given threshold.
* @param {string} filePath - The path to the file.
* @param {number} threshold - The threshold in bytes. Default is 10MB.
* @returns {boolean} True if the file is larger than the threshold, false otherwise.
*/
const isLargeFile = (filePath, threshold = 10 * 1024 * 1024) => {
if (!isFile(filePath)) {
throw new Error(`File ${filePath} is not a file`);
}
const size = fs.statSync(filePath).size;
return size > threshold;
};
// A "safe" file name is a bare basename: no path separators and no traversal.
// Use it to guard untrusted names (e.g. from shared collection config) before
// joining them into a filesystem path, so they can't escape the intended directory.
const isSafeFileName = (name) => {
return (
typeof name === 'string'
&& name.length > 0
&& name === path.basename(name)
&& !name.includes('/')
&& !name.includes('\\')
&& name !== '.'View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Point the path at a regular file, not a directory or symlink.
- Verify the path with ls before retrying.
When it happens
Trigger: Thrown at packages/bruno-cli/src/utils/filesystem.js:169 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/8065926929a5eb48.
Report an issue: GitHub.