{"record":{"id":"2e9e0b4370cde3f1","repo":"usebruno/bruno","slug":"collection-path-does-not-exist","errorCode":null,"errorMessage":"Collection path does not exist","messagePattern":"Collection path does not exist","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":2570,"sourceCode":"          bruJsons = bruJsons.concat(currentDirBruJsons);\n        };\n\n        await traverse(dir);\n        return bruJsons;\n      };\n\n      const orderedFiles = await getFilesInOrder(dir);\n      return orderedFiles;\n    };\n\n    const files = await getBruFilesRecursively(collectionPath);\n    return { name, files, ...variables };\n  });\n\n  ipcMain.handle('renderer:export-collection-zip', async (event, collectionPath, collectionName) => {\n    try {\n      if (!collectionPath || !fs.existsSync(collectionPath)) {\n        throw new Error('Collection path does not exist');\n      }\n\n      const defaultFileName = `${sanitizeName(collectionName)}.zip`;\n      const { filePath, canceled } = await dialog.showSaveDialog(mainWindow, {\n        title: 'Export Collection as ZIP',\n        defaultPath: defaultFileName,\n        filters: [{ name: 'Zip Files', extensions: ['zip'] }]\n      });\n\n      if (canceled || !filePath) {\n        return { success: false, canceled: true };\n      }\n\n      const ignoredDirectories = ['node_modules', '.git'];\n\n      await new Promise((resolve, reject) => {\n        const output = fs.createWriteStream(filePath);\n        const archive = archiver('zip', { zlib: { level: 9 } });","sourceCodeStart":2552,"sourceCodeEnd":2588,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L2552-L2588","documentation":"renderer:export-collection-zip requires collectionPath to be truthy and present on disk (fs.existsSync). Unlike install-postman-packages it does not check isDirectory. Throws before opening the save dialog.","triggerScenarios":"Calling renderer:export-collection-zip with a collectionPath that is empty or no longer exists.","commonSituations":"Collection moved/deleted/unmounted between open and export; race during collection close; stale path cached in renderer state.","solutions":["Verify collectionPath exists on disk before offering the export action.","Re-open the collection if the directory was moved.","Pass an absolute path resolved at click time."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const fs = require('fs');\nif (!collectionPath || !fs.existsSync(collectionPath)) {\n  throw new Error('Collection path does not exist');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await ipcRenderer.invoke('renderer:export-collection-zip', collectionPath, collectionName);\n} catch (err) {\n  if (/Collection path does not exist/.test(err.message)) {\n    // re-open the collection, then retry\n  } else {\n    throw err;\n  }\n}","preventionTips":["Verify collectionPath at click time, not at selection time.","Disable the export action when the collection is unmounted/closed."],"tags":["ipc","export","zip","filesystem","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}