{"record":{"id":"cdc1d390bafc6fff","repo":"usebruno/bruno","slug":"import-collection-failed-err-message","errorCode":null,"errorMessage":"Import collection failed: ${err.message}","messagePattern":"Import collection failed: (.+?)","errorType":"exception","errorClass":"BrunoError","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/importers/insomnia-collection.js","lineNumber":9,"sourceCode":"import { BrunoError } from 'utils/common/error';\nimport { insomniaToBruno } from '@usebruno/converters';\n\nexport const convertInsomniaToBruno = (data) => {\n  try {\n    return insomniaToBruno(data);\n  } catch (err) {\n    console.error('Error converting Insomnia to Bruno:', err);\n    throw new BrunoError('Import collection failed: ' + err.message);\n  }\n};\n\nexport const isInsomniaCollection = (data) => {\n  // Check for Insomnia v5 collection format – collection array must be present\n  if (typeof data.type === 'string' && data.type.startsWith('collection.insomnia.rest/5')) {\n    return Array.isArray(data.collection);\n  }\n\n  // Check for Insomnia v4 export format – must have __export_format and resources array\n  if (data._type === 'export') {\n    return Array.isArray(data.resources) && typeof data.__export_format === 'number';\n  }\n\n  return false;\n};\n","sourceCodeStart":1,"sourceCodeEnd":26,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/importers/insomnia-collection.js#L1-L26","documentation":"Thrown by convertInsomniaToBruno when the @usebruno/converters insomniaToBruno() function throws. It wraps the converter's error with a generic prefix and logs the original to the console.","triggerScenarios":"Passing data that isInsomniaCollection accepted but the converter cannot transform — e.g. an Insomnia v4/v5 export with missing required fields (method, URL, parentId), unknown resource types, or unsupported Insomnia features.","commonSituations":"Insomnia export from a much older/newer version than the converter supports, exports relying on plugin/gRPC/websocket entries the converter ignores, or partially-edited export files.","solutions":["Inspect the console.error output to see the real converter error.","Re-export from Insomnia using a supported version and the standard export action.","Strip unsupported resource types from the export before importing.","Update @usebruno/converters to the latest version and retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!isInsomniaCollection(data)) {\n  throw new Error('Not a recognized Insomnia export');\n}","typeGuard":"function isInsomniaCollection(data) {\n  if (typeof data?.type === 'string' && data.type.startsWith('collection.insomnia.rest/5')) {\n    return Array.isArray(data.collection);\n  }\n  if (data?._type === 'export') {\n    return Array.isArray(data.resources) && typeof data.__export_format === 'number';\n  }\n  return false;\n}","tryCatchPattern":"try {\n  convertInsomniaToBruno(data);\n} catch (err) {\n  console.error('Original converter error:', err);\n  throw err;\n}","preventionTips":["Run isInsomniaCollection before converting to fail fast with a clearer message.","Re-export from a supported Insomnia version.","Strip unsupported resource types from the export."],"tags":["import","insomnia","converter","collection"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}