{"record":{"id":"8aac39aa1f6f7b9a","repo":"usebruno/bruno","slug":"failed-to-process-parsedfile-filename-err-me-8aac39","errorCode":null,"errorMessage":"Failed to process ${parsedFile.fileName}: ${err.message}","messagePattern":"Failed to process (.+?): (.+?)","errorType":"exception","errorClass":"BrunoError","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/importers/postman-environment.js","lineNumber":15,"sourceCode":"import { BrunoError } from 'utils/common/error';\nimport { postmanToBrunoEnvironment } from '@usebruno/converters';\nimport { dedupeImportedSecrets } from 'utils/environments';\n\nconst importEnvironment = async (parsedFiles) => {\n  try {\n    const environments = [];\n\n    for (const parsedFile of parsedFiles) {\n      try {\n        const environment = postmanToBrunoEnvironment(parsedFile.content);\n        environments.push({ ...environment, variables: dedupeImportedSecrets(environment.variables) });\n      } catch (err) {\n        console.error(`Error processing file: ${parsedFile.fileName}`, err);\n        throw new BrunoError(`Failed to process ${parsedFile.fileName}: ${err.message}`);\n      }\n    }\n\n    return environments;\n  } catch (err) {\n    console.log(err);\n    throw err instanceof BrunoError ? err : new BrunoError('Import Environment failed');\n  }\n};\n\nexport default importEnvironment;\n","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/importers/postman-environment.js#L1-L27","documentation":"Per-file catch in the Postman environment importer. Fires when postmanToBrunoEnvironment(parsedFile.content) throws for a given file; wraps with the file name and the inner error message.","triggerScenarios":"A selected file accepted as JSON but not a valid Postman environment export — missing 'values' array, wrong shape, or a Postman collection (not environment) mistakenly imported via the environment flow.","commonSituations":"User picks a Postman collection JSON instead of an environment export, or an environment exported from a newer/older Postman version with a different shape.","solutions":["Confirm the file is a Postman environment (has a 'values' array of {key,value} entries), not a collection.","Re-export the environment from Postman's Environments tab.","Inspect the inner message after the colon for the specific transform failure.","Retry on the latest Bruno version if the export is valid but conversion still fails."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!parsedFile.content?.values && !Array.isArray(parsedFile.content?.variables)) {\n  throw new Error(`${parsedFile.fileName} does not look like a Postman environment`);\n}","typeGuard":"function isPostmanEnvironment(data) {\n  return data !== null && typeof data === 'object' && Array.isArray(data.values);\n}","tryCatchPattern":"try {\n  await importEnvironment(parsedFiles);\n} catch (err) {\n  const m = err.message.match(/Failed to process (.*?): (.*)/);\n  if (m) console.error(`${m[1]}: ${m[2]}`);\n  throw err;\n}","preventionTips":["Confirm the file is a Postman environment (has 'values'), not a collection.","Re-export environments from Postman's Environments tab.","Filter file selection to environment exports only."],"tags":["import","postman","environment","error-wrapping"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}