{"record":{"id":"2557d8320f842ed3","repo":"usebruno/bruno","slug":"collectionpathname-is-required","errorCode":null,"errorMessage":"collectionPathname is required","messagePattern":"collectionPathname is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":2439,"sourceCode":"    try {\n      // Convert Postman collection to Bruno format\n      // Returns { collection, issues } where issues tracks items that were skipped or degraded\n      const result = await postmanToBruno(postmanCollection, {\n        useWorkers: true,\n        // preserve scripts without any pm.* -> bru.* translation\n        preserveScripts: !!options.preserveScripts\n      });\n\n      return result;\n    } catch (error) {\n      console.error('Error converting Postman to Bruno:', error);\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:install-postman-packages', async (_event, collectionPathname, packages) => {\n    if (typeof collectionPathname !== 'string' || !collectionPathname) {\n      throw new Error('collectionPathname is required');\n    }\n    if (!Array.isArray(packages) || packages.length === 0) {\n      throw new Error('packages must be a non-empty array');\n    }\n    if (!fs.existsSync(collectionPathname) || !fs.statSync(collectionPathname).isDirectory()) {\n      throw new Error(`Collection path does not exist: ${collectionPathname}`);\n    }\n\n    const invalid = packages.filter((p) => !isValidNpmPackageName(p));\n    if (invalid.length > 0) {\n      throw new Error(`Invalid package name(s): ${invalid.join(', ')}`);\n    }\n\n    await waitForShellEnv();\n    return runNpmInstall({ collectionPath: collectionPathname, packages });\n  });\n\n  ipcMain.handle('renderer:get-collection-json', async (event, collectionPath) => {","sourceCodeStart":2421,"sourceCodeEnd":2457,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L2421-L2457","documentation":"renderer:install-postman-packages validates that collectionPathname is a non-empty string before proceeding. Throws synchronously outside any try/catch so it rejects the IPC immediately.","triggerScenarios":"Calling renderer:install-postman-packages with collectionPathname omitted, empty, or non-string.","commonSituations":"Renderer forgets to pass the collection root path; conversion flow produced an empty collection context; argument ordering bug (positional IPC args shifted).","solutions":["Pass the absolute path to the collection directory as the first positional argument.","Verify the IPC invocation signature matches (collectionPathname, packages).","Guard the renderer-side call with a truthy check on the collection path."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (typeof collectionPathname !== 'string' || collectionPathname.length === 0) {\n  throw new Error('collectionPathname is required');\n}","typeGuard":"/** @param {unknown} p @returns {p is string} */\nfunction isNonEmptyString(p) {\n  return typeof p === 'string' && p.length > 0;\n}","tryCatchPattern":null,"preventionTips":["Forward the collection's root directory path from the renderer state.","Match IPC positional argument order exactly (collectionPathname, packages)."],"tags":["ipc","postman","validation","argument-validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}