usebruno/bruno · error · Error

Export location does not exist

Error message

Export location does not exist

What it means

renderer:export-collection-postman validates dirPath is truthy and exists on disk. Thrown before any path resolution, guarding the export target.

Source

Thrown at packages/bruno-electron/src/ipc/collection.js:2630

              archive.file(fullPath, { name: entryArchivePath });
            }
          }
        };

        addDirectoryToArchive(collectionPath, '');
        archive.finalize();
      });

      return { success: true, filePath };
    } catch (error) {
      throw error;
    }
  });

  ipcMain.handle('renderer:export-collection-postman', async (event, dirPath, fileName, content, overwrite = false) => {
    try {
      if (!dirPath || !fs.existsSync(dirPath)) {
        throw new Error('Export location does not exist');
      }

      // ensure the resolved path is inside the export directory
      const resolvedDir = path.resolve(dirPath);
      const filePath = path.resolve(resolvedDir, fileName);
      if (!filePath.startsWith(resolvedDir + path.sep) && filePath !== resolvedDir) {
        throw new Error('Invalid file name');
      }

      if (!overwrite && fs.existsSync(filePath)) {
        throw new Error(`path: ${filePath} already exists`);
      }

      await writeFile(filePath, content);

      return { success: true, filePath };
    } catch (error) {
      return Promise.reject(error);

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pick an existing directory in the save dialog before exporting.
  2. Create the directory (fs.mkdirSync recursive) before invoking.
  3. Default to app.getPath('desktop') or os.homedir() when no path is chosen.
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
if (!dirPath || !fs.existsSync(dirPath)) {
  fs.mkdirSync(dirPath, { recursive: true }); // or re-prompt
}

Try / catch

try {
  await ipcRenderer.invoke('renderer:export-collection-postman', dirPath, fileName, content, overwrite);
} catch (err) {
  if (/Export location does not exist/.test(err.message)) {
    // ask the user to pick a valid directory
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Calling renderer:export-collection-postman with a dirPath that is empty, null, or not present on disk.

Common situations: User-selected export directory deleted or on unmounted removable media; default export dir unset.

Related errors


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