{"record":{"id":"012c23c239a1d47e","repo":"usebruno/bruno","slug":"bruno-json-not-found","errorCode":null,"errorMessage":"bruno.json not found","messagePattern":"bruno\\.json not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/openapi-sync.js","lineNumber":265,"sourceCode":" */\nconst loadBrunoConfig = (collectionPath) => {\n  const format = getCollectionFormat(collectionPath);\n  let brunoConfig;\n  let collectionRoot;\n\n  if (format === 'yml') {\n    const configFilePath = path.join(collectionPath, 'opencollection.yml');\n    if (!fs.existsSync(configFilePath)) {\n      throw new Error('opencollection.yml not found');\n    }\n    const content = fs.readFileSync(configFilePath, 'utf8');\n    const parsed = parseCollection(content, { format });\n    brunoConfig = parsed.brunoConfig;\n    collectionRoot = parsed.collectionRoot;\n  } else {\n    const brunoJsonPath = path.join(collectionPath, 'bruno.json');\n    if (!fs.existsSync(brunoJsonPath)) {\n      throw new Error('bruno.json not found');\n    }\n    brunoConfig = JSON.parse(fs.readFileSync(brunoJsonPath, 'utf8'));\n  }\n\n  // Resolve relative openapi sourceUrls to absolute so all callers get consistent paths\n  if (Array.isArray(brunoConfig?.openapi)) {\n    brunoConfig.openapi = brunoConfig.openapi.map((entry) => ({\n      ...entry,\n      sourceUrl: resolveSourceUrl(collectionPath, entry.sourceUrl)\n    }));\n  }\n\n  return { format, brunoConfig, collectionRoot };\n};\n\n/**\n * Save bruno config to disk (bruno.json or opencollection.yml).\n */","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/openapi-sync.js#L247-L283","documentation":"Error \"bruno.json not found\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/openapi-sync.js:265 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the directory is a valid Bruno collection containing bruno.json.","Regenerate bruno.json by opening/saving the collection in Bruno."],"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"}