usebruno/bruno · error · Error

path: ${pathname} already exists

Error message

path: ${pathname} already exists

What it means

Error "path: ${pathname} already exists" thrown in usebruno/bruno.

Source

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

      const format = getCollectionFormat(collectionPathname);
      const filename = format === 'yml' ? 'opencollection.yml' : 'collection.bru';
      const content = await stringifyCollection(collectionRoot, brunoConfig, { format });

      const filePath = path.join(collectionPathname, filename);
      const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : null;
      if (content === existing) return; // skip write if content unchanged
      await writeFile(filePath, content);
    } catch (error) {
      console.error('Error in save-collection-root:', error);
      return Promise.reject(error);
    }
  });

  // new request
  ipcMain.handle('renderer:new-request', async (event, pathname, request) => {
    try {
      if (fs.existsSync(pathname)) {
        throw new Error(`path: ${pathname} already exists`);
      }

      const collectionPath = findCollectionPathByItemPath(pathname);
      if (!collectionPath) {
        throw new Error('Collection not found for the given pathname');
      }
      const format = getCollectionFormat(collectionPath);

      // For the actual filename part, we want to be strict
      const baseFilename = request?.filename?.replace(`.${format}`, '');
      if (!validateName(baseFilename)) {
        throw new Error(`${request.filename} is not a valid filename`);
      }
      validatePathIsInsideCollection(pathname);

      const content = await stringifyRequestViaWorker(request, { format });
      await writeFile(pathname, content);
    } catch (error) {

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Choose a different name or location, or delete/rename the existing item.

When it happens

Trigger: Thrown at packages/bruno-electron/src/ipc/collection.js:542 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/cfc985d2f7aed7e5. Report an issue: GitHub.