{"record":{"id":"eca54ebf2fe0f5cd","repo":"usebruno/bruno","slug":"failed-to-parse-content-as-json-or-yaml","errorCode":null,"errorMessage":"Failed to parse content as JSON or YAML","messagePattern":"Failed to parse content as JSON or YAML","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-cli/src/commands/import.js","lineNumber":141,"sourceCode":"        return content;\n      }\n    } else {\n      // Handle file input\n      if (!await exists(source)) {\n        throw new Error(`File does not exist: ${source}`);\n      }\n      content = fs.readFileSync(source, 'utf8');\n    }\n\n    // If content is a string, try to parse as JSON or YAML\n    if (typeof content === 'string') {\n      try {\n        return JSON.parse(content);\n      } catch (jsonError) {\n        try {\n          return jsyaml.load(content);\n        } catch (yamlError) {\n          throw new Error('Failed to parse content as JSON or YAML');\n        }\n      }\n    }\n\n    return content;\n  } catch (error) {\n    // Let the specific error handling from above propagate\n    throw error;\n  }\n};\n\nconst readWSDLFile = async (source, options = {}) => {\n  try {\n    let content;\n\n    if (isUrl(source)) {\n      // Handle URL input\n      console.log(chalk.yellow(`Fetching WSDL from URL: ${source}`));","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-cli/src/commands/import.js#L123-L159","documentation":"Error \"Failed to parse content as JSON or YAML\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-cli/src/commands/import.js:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the file content with a JSON/YAML linter.","Ensure the downloaded or provided content is the actual collection document, not an HTML error page."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}