usebruno/bruno · error · BrunoError
Import collection failed: ${err.message}
Error message
Import collection failed: ${err.message} What it means
Thrown by convertOpenapiToBruno when the @usebruno/converters openApiToBruno() function throws. Generic prefix wraps the original converter error which is also console.error-ed.
Source
Thrown at packages/bruno-app/src/utils/importers/openapi-collection.js:9
import { BrunoError } from 'utils/common/error';
import { openApiToBruno } from '@usebruno/converters';
export const convertOpenapiToBruno = (data, options = {}) => {
try {
return openApiToBruno(data, options);
} catch (err) {
console.error('Error converting OpenAPI to Bruno:', err);
throw new BrunoError('Import collection failed: ' + err.message);
}
};
export const isOpenApiSpec = (data) => {
if (!data || typeof data !== 'object') {
return false;
}
if (typeof data.info !== 'object' || data.info === null) {
return false;
}
if (typeof data.openapi === 'string' && data.openapi.trim().length) {
return true;
}
if (typeof data.swagger === 'string' && data.swagger.trim().length) {
return true;View on GitHub (pinned to 9bdd81c7bd)
Solutions
- Read the console.error to find the underlying converter message.
- Validate the spec with a tool like Spectral or swagger-cli before importing.
- Inline external $refs or remove unsupported features.
- Update @usebruno/converters and retry.
Defensive patterns
Strategy: try-catch
Validate before calling
if (!isOpenApiSpec(data)) {
throw new Error('Not a recognized OpenAPI spec');
} Type guard
function isOpenApiSpec(data) {
if (!data || typeof data !== 'object') return false;
if (typeof data.info !== 'object' || data.info === null) return false;
return Boolean(data.openapi || data.swagger);
} Try / catch
try {
convertOpenapiToBruno(data);
} catch (err) {
console.error('Original converter error:', err);
throw err;
} Prevention
- Validate the spec with Spectral/swagger-cli before importing.
- Inline external $refs and remove unsupported features.
- Run isOpenApiSpec first to fail with a precise message.
When it happens
Trigger: An OpenAPI spec that isOpenApiSpec accepted but the converter cannot transform: invalid OpenAPI 3.x structure, missing paths, $ref resolution failures, unsupported content types, or malformed operation definitions.
Common situations: Swagger 2.0 spec passed to an OpenAPI 3 converter, specs with external $refs that cannot be resolved, circular refs, or specs exported by tools producing non-standard extensions.
Related errors
- Import collection failed: ${err.message}
- Import OpenCollection failed
- Import collection failed
- The Collection file is corrupted
- Invalid collection: Neither bruno.json nor opencollection.ym
AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13).
Data as JSON: /api/errors/3b9f5063cc06582d.
Report an issue: GitHub.