{"record":{"id":"6d53148f5e3f02f2","repo":"affaan-m/ECC","slug":"a-normalized-install-request-is-required","errorCode":null,"errorMessage":"A normalized install request is required","messagePattern":"A normalized install request is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install/runtime.js","lineNumber":13,"sourceCode":"'use strict';\n\nconst {\n  createLegacyCompatInstallPlan,\n  createLegacyInstallPlan,\n  createManifestInstallPlan,\n} = require('../install-executor');\nconst { resolveInvocationEnvironment } = require('../invocation-environment');\nconst { withHookConsent } = require('./hook-consent');\n\nfunction createInstallPlanFromRequest(request, options = {}) {\n  if (!request || typeof request !== 'object') {\n    throw new Error('A normalized install request is required');\n  }\n\n  return withHookConsent(createRawInstallPlan(request, options), request.hookConsent || null);\n}\n\nfunction createRawInstallPlan(request, options = {}) {\n  if (request.mode === 'manifest') {\n    return createManifestInstallPlan({\n      target: request.target,\n      profileId: request.profileId,\n      moduleIds: request.moduleIds,\n      includeComponentIds: request.includeComponentIds,\n      excludeComponentIds: request.excludeComponentIds,\n      projectRoot: options.projectRoot,\n      homeDir: options.homeDir,\n      env: resolveInvocationEnvironment(options),\n      sourceRoot: options.sourceRoot,\n      exemptValidationCodes: options.exemptValidationCodes || [],","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/runtime.js#L1-L31","documentation":"createInstallPlanFromRequest only accepts an already-normalized install request object produced by normalizeInstallRequest/request. Passing null, undefined, or a non-object skips planning entirely and throws immediately, since no mode or selections can be read.","triggerScenarios":"Calling createInstallPlanFromRequest(null), createInstallPlanFromRequest(undefined), or passing a primitive such as a string or number instead of the normalized request object.","commonSituations":"Forgetting to call normalizeInstallRequest before planning; a request variable left undefined because an earlier async call failed silently; refactoring that changed the call signature.","solutions":["Build the request with request()/normalizeInstallRequest() first and pass its result.","Check the value passed is a non-null object before calling.","Inspect the call site for a typo or a lost return value from the normalizer."],"exampleFix":"// before\ncreateInstallPlanFromRequest(opts)\n// after\nconst req = normalizeInstallRequest(opts)\ncreateInstallPlanFromRequest(req)","handlingStrategy":"type-guard","validationCode":"if (request === null || typeof request !== 'object') throw new Error('Call normalizeInstallRequest() first; pass its result to createInstallPlanFromRequest')","typeGuard":"function isNormalizedRequest(x) {\n  return x !== null && typeof x === 'object' && typeof x.mode === 'string'\n}\nif (!isNormalizedRequest(req)) throw new TypeError('A normalized install request is required')","tryCatchPattern":"try {\n  const plan = createInstallPlanFromRequest(req)\n} catch (err) {\n  if (err.message === 'A normalized install request is required') {\n    console.error('Request object missing — ensure normalizeInstallRequest() succeeded and its result was passed')\n  } else throw err\n}","preventionTips":["Always create requests via normalizeInstallRequest/request, never inline literals.","Check the normalizer's return value before passing it on.","Don't let an earlier failed async assignment silently leave the request undefined.","Add a unit test asserting plan creation from a real normalized request."],"tags":["install","validation","type-check"],"backgroundTag":"null-argument","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}