{"record":{"id":"84c5b5ae3b64f34e","repo":"affaan-m/ECC","slug":"no-hooks-cannot-be-combined-with-an-explicit-hooks-runtime","errorCode":null,"errorMessage":"--no-hooks cannot be combined with an explicit hooks-runtime module selection","messagePattern":"--no-hooks cannot be combined with an explicit hooks-runtime module selection","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install/request.js","lineNumber":131,"sourceCode":"  const requestedIncludeComponentIds = dedupeStrings([\n    ...(config?.includeComponentIds || []),\n    ...(options.includeComponentIds || []),\n  ]);\n  const includeComponentIds = dedupeStrings([\n    ...requestedIncludeComponentIds,\n    ...(localeComponentId ? [localeComponentId] : []),\n  ]);\n  const excludeComponentIds = dedupeStrings([\n    ...(config?.excludeComponentIds || []),\n    ...(options.excludeComponentIds || []),\n  ]);\n  const legacyLanguages = dedupeStrings(dedupeStrings([\n    ...(Array.isArray(options.legacyLanguages) ? options.legacyLanguages : []),\n    ...(Array.isArray(options.languages) ? options.languages : []),\n  ]).map(language => language.toLowerCase()));\n  const hookConsent = resolveHookConsentFlags(options);\n  if (hookConsent === 'declined' && moduleIds.includes('hooks-runtime')) {\n    throw new Error('--no-hooks cannot be combined with an explicit hooks-runtime module selection');\n  }\n  const hasManifestBaseSelection = Boolean(profileId) || moduleIds.length > 0 || includeComponentIds.length > 0;\n  const hasNonLocaleManifestSelection = Boolean(profileId)\n    || moduleIds.length > 0\n    || requestedIncludeComponentIds.length > 0\n    || excludeComponentIds.length > 0;\n  const usingManifestMode = hasManifestBaseSelection || excludeComponentIds.length > 0;\n\n  if (hasNonLocaleManifestSelection && legacyLanguages.length > 0) {\n    throw new Error(\n      'Legacy language arguments cannot be combined with --profile, --modules, --with, --without, or manifest config selections'\n    );\n  }\n\n  if (!options.help && !hasManifestBaseSelection && legacyLanguages.length === 0) {\n    throw new Error('No install profile, module IDs, included components, or legacy languages were provided');\n  }\n","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install/request.js#L113-L149","documentation":"normalizeInstallRequest resolves hook consent flags via resolveHookConsentFlags. If the user explicitly declined hooks (`--no-hooks`, consent === 'declined') while the merged moduleIds explicitly include the 'hooks-runtime' module, the request is self-contradictory and throws this error.","triggerScenarios":"Calling normalizeInstallRequest with options like `{ noHooks: true, moduleIds: ['hooks-runtime'] }` or CLI `install --no-hooks --module hooks-runtime`; also when a config file lists hooks-runtime in moduleIds while --no-hooks is passed on the command line (options and config moduleIds are merged before the check).","commonSituations":"A saved install config that includes hooks-runtime while the user passes --no-hooks to disable hooks for one run; combining a profile or module list that bundles hooks-runtime with --no-hooks; scripting flags from different sources that disagree.","solutions":["Remove 'hooks-runtime' from the module list (CLI --module args and any config moduleIds) when using --no-hooks.","Drop the --no-hooks flag if you actually want hooks installed.","Edit your install config file to remove the hooks-runtime entry if it's the source of the conflict.","Use --enable-hooks explicitly if hook consent ambiguity is the issue."],"exampleFix":"// before\ninstall --no-hooks --module hooks-runtime\n\n// after\ninstall --no-hooks // hooks-runtime removed from module selection\n// or\ninstall --module hooks-runtime // --no-hooks removed","handlingStrategy":"validation","validationCode":"const merged = [...(config?.moduleIds || []), ...(options.moduleIds || [])];\nif (options.noHooks && merged.includes('hooks-runtime')) {\n  throw new Error('--no-hooks conflicts with an explicit hooks-runtime module selection');\n}","typeGuard":"function hooksSelectionConsistent(opts) {\n  return !(resolveHookConsentFlags(opts) === 'declined'\n    && [...(opts.moduleIds || [])].includes('hooks-runtime'));\n}","tryCatchPattern":"try {\n  const req = normalizeInstallRequest(options);\n} catch (e) {\n  if (e.message.includes('--no-hooks cannot be combined')) {\n    console.error('Remove hooks-runtime from module selection or drop --no-hooks.');\n    return;\n  }\n  throw e;\n}","preventionTips":["Never combine --no-hooks with a module list containing hooks-runtime.","Audit config-file moduleIds when overriding consent on the command line — options and config are merged.","Express 'no hooks' by omitting hooks-runtime rather than passing --no-hooks with explicit selections.","Add a pre-flight consistency check in wrapper scripts that merge flags from multiple sources."],"tags":["cli","conflicting-options","hooks","validation"],"backgroundTag":"mutually-exclusive-flags","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"}