{"record":{"id":"680fd8946aae51ac","repo":"vercel/turborepo","slug":"package-manager-unexpected","errorCode":"package_manager-unexpected","errorMessage":"Not an aube project","messagePattern":"Not an aube project","errorType":"exception","errorClass":"ConvertError","httpStatus":null,"severity":"error","filePath":"packages/turbo-workspaces/src/managers/aube.ts","lineNumber":58,"sourceCode":"\nconst UNDERLYING_MANAGERS = {\n  npm,\n  pnpm,\n  yarn,\n  bun\n} as const;\n\n// eslint-disable-next-line @typescript-eslint/require-await -- must match the detect type signature\nasync function detect(args: DetectArgs): Promise<boolean> {\n  return (\n    getWorkspacePackageManager({ workspaceRoot: args.workspaceRoot }) ===\n    PACKAGE_MANAGER_DETAILS.name\n  );\n}\n\nasync function read(args: ReadArgs): Promise<Project> {\n  if (!(await detect(args))) {\n    throw new ConvertError(\"Not an aube project\", {\n      type: \"package_manager-unexpected\"\n    });\n  }\n\n  const underlying = getUnderlyingLockfileManager({\n    workspaceRoot: args.workspaceRoot\n  });\n  const underlyingHandler = UNDERLYING_MANAGERS[underlying];\n\n  if (await underlyingHandler.detect(args)) {\n    const project = await underlyingHandler.read(args);\n    return { ...project, packageManager: PACKAGE_MANAGER_DETAILS.name };\n  }\n\n  const packageJson = getPackageJson(args);\n  const { name, description } = getWorkspaceInfo(args);\n  const lockfile = getUnderlyingLockfileName({\n    workspaceRoot: args.workspaceRoot","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/vercel/turborepo/blob/9f94a7d215b3881942527dd526afa3fc650869d5/packages/turbo-workspaces/src/managers/aube.ts#L40-L76","documentation":"The aube manager's read() is a guarded internal step: it re-runs detect() (which checks the workspace's declared manager equals 'aube') and throws ConvertError type package_manager-unexpected if detection fails. In the normal getWorkspaceDetails() flow read() runs only after detect() succeeded, so hitting this means read() was invoked directly or workspace state changed between the calls.","triggerScenarios":"Calling MANAGERS.aube.read({ workspaceRoot }) directly on a project whose declared package manager is not aube (or whose aube lockfile is absent), or mutating package.json between getWorkspaceDetails()'s detect and read phases.","commonSituations":"Custom scripts or tests reaching into turbo-workspaces internals and calling read() without detect(); concurrent edits during conversion.","solutions":["Use getWorkspaceDetails() instead of calling a manager's read() directly — it runs detect() first and only reads the matching manager","If calling read() directly, run MANAGERS.aube.detect({ workspaceRoot }) first and bail on false","Ensure the project genuinely declares aube (devEngines.packageManager/packageManager) and has its lockfile"],"exampleFix":"// before\nconst project = await MANAGERS.aube.read({ workspaceRoot }); // not an aube repo\n\n// after\nif (await MANAGERS.aube.detect({ workspaceRoot })) {\n  const project = await MANAGERS.aube.read({ workspaceRoot });\n}","handlingStrategy":"validation","validationCode":"if (await MANAGERS.aube.detect({ workspaceRoot })) {\n  const project = await MANAGERS.aube.read({ workspaceRoot });\n} else {\n  // not an aube workspace — use getWorkspaceDetails() instead\n}","typeGuard":"function isUnexpectedManagerError(e: unknown): boolean {\n  return e instanceof ConvertError && e.type === \"package_manager-unexpected\";\n}","tryCatchPattern":"try {\n  const project = await MANAGERS.aube.read({ workspaceRoot });\n} catch (e) {\n  if (e instanceof ConvertError && e.type === \"package_manager-unexpected\") {\n    // fall back to generic detection: getWorkspaceDetails({ root: workspaceRoot })\n  } else throw e;\n}","preventionTips":["Never call a manager's read() without a preceding detect() in the same tick","Prefer the getWorkspaceDetails() entry point, which handles detection for you","Re-detect after any package.json mutation between reads"],"tags":["package-manager","detection","workspace","aube"],"backgroundTag":"package-manager-mismatch","analyzedSha":"9f94a7d215b3881942527dd526afa3fc650869d5","analyzedAt":"2026-08-16T19:47:29.531Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}