usebruno/bruno · warning · Error

File path is required

Error message

File path is required

What it means

renderer:show-in-folder requires a truthy filePath before delegating to Electron's shell.showItemInFolder. Thrown on empty string, null, or undefined so the native call is never invoked with an invalid path.

Source

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

      const content = await stringifyRequestViaWorker(request, { format });

      await writeFile(targetPathname, content);

      if (request.examples) {
        syncExampleUidsCache(collectionPath, request.examples);
      }

      return { newPathname: targetPathname };
    } catch (error) {
      console.error('Error saving scratch request:', error);
      return Promise.reject(error);
    }
  });

  ipcMain.handle('renderer:show-in-folder', async (event, filePath) => {
    try {
      if (!filePath) {
        throw new Error('File path is required');
      }
      shell.showItemInFolder(filePath);
    } catch (error) {
      console.error('Error in show-in-folder: ', error);
      throw error;
    }
  });

  // Implement the Postman to Bruno conversion handler
  ipcMain.handle('renderer:convert-postman-to-bruno', async (event, postmanCollection, options = {}) => {
    try {
      // Convert Postman collection to Bruno format
      // Returns { collection, issues } where issues tracks items that were skipped or degraded
      const result = await postmanToBruno(postmanCollection, {
        useWorkers: true,
        // preserve scripts without any pm.* -> bru.* translation
        preserveScripts: !!options.preserveScripts
      });

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Pass a non-empty absolute file path.
  2. Disable the 'Show in folder' UI action when the selected item has no pathname.
Defensive patterns

Strategy: validation

Validate before calling

if (!filePath || typeof filePath !== 'string') {
  throw new Error('filePath is required to reveal in folder');
}

Type guard

/** @param {unknown} p @returns {p is string} */
function isNonEmptyString(p) {
  return typeof p === 'string' && p.length > 0;
}

Try / catch

try {
  await ipcRenderer.invoke('renderer:show-in-folder', filePath);
} catch (err) {
  if (/File path is required/.test(err.message)) {
    // disable the UI action; no file to reveal
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Calling renderer:show-in-folder with no filePath argument (empty/null/undefined).

Common situations: Renderer offers 'Reveal in Finder' on a virtual or unsaved request that has no on-disk file; event fired before a path was assigned.

Related errors


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