{"record":{"id":"175faf6b99fdeb0c","repo":"usebruno/bruno","slug":"selected-api-spec-is-not-available-open-it-in-the","errorCode":null,"errorMessage":"Selected API spec is not available. Open it in the workspace first.","messagePattern":"Selected API spec is not available\\. Open it in the workspace first\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/mock-server/mock-server-instances.js","lineNumber":330,"sourceCode":"export const resolveMockServerStartPayload = (instance, { collection, apiSpecs, workspacePath }) => {\n  const mockServerUid = instance.uid;\n  const resolvedWorkspacePath = workspacePath || null;\n\n  if (instance.sourceType === 'manual') {\n    return {\n      mockServerUid,\n      serverName: instance.name,\n      sourceType: 'manual',\n      workspacePath: resolvedWorkspacePath,\n      port: Number(instance.port),\n      globalDelay: Number(instance.globalDelay) || 0\n    };\n  }\n\n  if (instance.sourceType === 'spec') {\n    const spec = resolveInstanceSpec(instance, apiSpecs);\n    if (!spec?.pathname) {\n      throw new Error('Selected API spec is not available. Open it in the workspace first.');\n    }\n\n    return {\n      mockServerUid,\n      serverName: instance.name,\n      sourceType: 'spec',\n      specPath: spec.pathname,\n      workspacePath: resolvedWorkspacePath,\n      port: Number(instance.port),\n      globalDelay: Number(instance.globalDelay) || 0\n    };\n  }\n\n  if (!collection?.pathname) {\n    throw new Error('Selected collection is not available.');\n  }\n\n  return {","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/mock-server/mock-server-instances.js#L312-L348","documentation":"Error \"Selected API spec is not available. Open it in the workspace first.\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-app/src/utils/mock-server/mock-server-instances.js:330 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open the API spec in the workspace first, then select it for the mock server.","Verify the spec file still exists at its registered path."],"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"}