{"record":{"id":"954f7c59e19db0a2","repo":"lerna/lerna","slug":"failed-to-replace-env-in-config-orig","errorCode":null,"errorMessage":"Failed to replace env in config: ${orig}","messagePattern":"Failed to replace env in config: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libs/core/src/lib/npm-conf/env-replace.ts","lineNumber":21,"sourceCode":"  if (typeof str !== \"string\" || !str) {\n    return str;\n  }\n\n  // Replace any ${ENV} values with the appropriate environment\n  const regex = /(\\\\*)\\$\\{([^}]+)\\}/g;\n\n  // TODO: refactor based on TS feedback\n  // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n  // @ts-ignore\n  return str.replace(regex, (orig, esc, name) => {\n    esc = esc.length > 0 && esc.length % 2;\n\n    if (esc) {\n      return orig;\n    }\n\n    if (process.env[name] === undefined) {\n      throw new Error(`Failed to replace env in config: ${orig}`);\n    }\n\n    return process.env[name];\n  });\n}\n","sourceCodeStart":3,"sourceCodeEnd":27,"githubUrl":"https://github.com/lerna/lerna/blob/35d15a1567932be97759f512d8b8033dad72b411/libs/core/src/lib/npm-conf/env-replace.ts#L3-L27","documentation":"Error \"Failed to replace env in config: ${orig}\" thrown in lerna/lerna.","triggerScenarios":"Thrown at libs/core/src/lib/npm-conf/env-replace.ts:21 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35d15a1567932be97759f512d8b8033dad72b411","analyzedAt":"2026-08-27T05:01:00.632Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}