usebruno/bruno · error · Error

Collection not found for the given pathname

Error message

Collection not found for the given pathname

What it means

Error "Collection not found for the given pathname" thrown in usebruno/bruno.

Source

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

      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) {
      return Promise.reject(error);
    }
  });

  // save request

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Reload the collection and confirm the pathname is correct.
  2. Check the item still exists on disk within the collection.

When it happens

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