{"record":{"id":"8065926929a5eb48","repo":"usebruno/bruno","slug":"file-filepath-is-not-a-file","errorCode":null,"errorMessage":"File ${filePath} is not a file","messagePattern":"File (.+?) is not a file","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-cli/src/utils/filesystem.js","lineNumber":169,"sourceCode":"  if (name.length > 255) return false; // max name length\n  if (reservedDeviceNames.test(name)) return false; // windows reserved names\n\n  return (\n    firstCharacter.test(name)\n    && middleCharacters.test(name)\n    && lastCharacter.test(name)\n  );\n};\n\n/**\n * Checks if a file is larger than a given threshold.\n * @param {string} filePath - The path to the file.\n * @param {number} threshold - The threshold in bytes. Default is 10MB.\n * @returns {boolean} True if the file is larger than the threshold, false otherwise.\n */\nconst isLargeFile = (filePath, threshold = 10 * 1024 * 1024) => {\n  if (!isFile(filePath)) {\n    throw new Error(`File ${filePath} is not a file`);\n  }\n\n  const size = fs.statSync(filePath).size;\n\n  return size > threshold;\n};\n\n// A \"safe\" file name is a bare basename: no path separators and no traversal.\n// Use it to guard untrusted names (e.g. from shared collection config) before\n// joining them into a filesystem path, so they can't escape the intended directory.\nconst isSafeFileName = (name) => {\n  return (\n    typeof name === 'string'\n    && name.length > 0\n    && name === path.basename(name)\n    && !name.includes('/')\n    && !name.includes('\\\\')\n    && name !== '.'","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-cli/src/utils/filesystem.js#L151-L187","documentation":"Error \"File ${filePath} is not a file\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-cli/src/utils/filesystem.js:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the path at a regular file, not a directory or symlink.","Verify the path with ls before retrying."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}