usebruno/bruno · error · BrunoError

Failed to process ${parsedFile.fileName}: ${err.message}

Error message

Failed to process ${parsedFile.fileName}: ${err.message}

What it means

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.

Source

Thrown at packages/bruno-app/src/utils/importers/postman-environment.js:15

import { BrunoError } from 'utils/common/error';
import { postmanToBrunoEnvironment } from '@usebruno/converters';
import { dedupeImportedSecrets } from 'utils/environments';

const importEnvironment = async (parsedFiles) => {
  try {
    const environments = [];

    for (const parsedFile of parsedFiles) {
      try {
        const environment = postmanToBrunoEnvironment(parsedFile.content);
        environments.push({ ...environment, variables: dedupeImportedSecrets(environment.variables) });
      } catch (err) {
        console.error(`Error processing file: ${parsedFile.fileName}`, err);
        throw new BrunoError(`Failed to process ${parsedFile.fileName}: ${err.message}`);
      }
    }

    return environments;
  } catch (err) {
    console.log(err);
    throw err instanceof BrunoError ? err : new BrunoError('Import Environment failed');
  }
};

export default importEnvironment;

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Confirm the file is a Postman environment (has a 'values' array of {key,value} entries), not a collection.
  2. Re-export the environment from Postman's Environments tab.
  3. Inspect the inner message after the colon for the specific transform failure.
  4. Retry on the latest Bruno version if the export is valid but conversion still fails.
Defensive patterns

Strategy: try-catch

Validate before calling

if (!parsedFile.content?.values && !Array.isArray(parsedFile.content?.variables)) {
  throw new Error(`${parsedFile.fileName} does not look like a Postman environment`);
}

Type guard

function isPostmanEnvironment(data) {
  return data !== null && typeof data === 'object' && Array.isArray(data.values);
}

Try / catch

try {
  await importEnvironment(parsedFiles);
} catch (err) {
  const m = err.message.match(/Failed to process (.*?): (.*)/);
  if (m) console.error(`${m[1]}: ${m[2]}`);
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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