angular/angular-cli · error · JobDoesNotExistException

<null>

Error message

<null>

What it means

createDispatcher's job handler tries to delegate to a matching job from registered delegate jobs or a defaultDelegate. If neither exists, it throws JobDoesNotExistException('<null>') — meaning no job was registered to dispatch to.

Source

Thrown at packages/angular_devkit/architect/src/jobs/dispatcher.ts:56

 * @param options
 */
export function createDispatcher<A extends JsonValue, I extends JsonValue, O extends JsonValue>(
  options: Partial<Readwrite<JobDescription>> = {},
): JobDispatcher<A, I, O> {
  let defaultDelegate: JobName | null = null;
  const conditionalDelegateList: [(args: JsonValue) => boolean, JobName][] = [];

  const job: JobHandler<JsonValue, JsonValue, JsonValue> = Object.assign(
    (argument: JsonValue, context: JobHandlerContext) => {
      const maybeDelegate = conditionalDelegateList.find(([predicate]) => predicate(argument));
      let delegate: Job<JsonValue, JsonValue, JsonValue>;

      if (maybeDelegate) {
        delegate = context.scheduler.schedule(maybeDelegate[1], argument);
      } else if (defaultDelegate) {
        delegate = context.scheduler.schedule(defaultDelegate, argument);
      } else {
        throw new JobDoesNotExistException('<null>');
      }

      context.inboundBus.subscribe(delegate.inboundBus);

      return delegate.outboundBus;
    },
    {
      jobDescription: options,
    },
  );

  return Object.assign(job, {
    setDefaultJob(name: JobName | null | JobHandler<JsonValue, JsonValue, JsonValue>) {
      if (isJobHandler(name)) {
        name = name.jobDescription.name === undefined ? null : name.jobDescription.name;
      }

      defaultDelegate = name;

View on GitHub (pinned to bb72145f9a)

Solutions

  1. Register the delegate job(s) with the scheduler/registry before creating the dispatcher
  2. Provide a defaultDelegate job name so unmatched dispatches have a fallback
  3. Check that the dispatch argument/name matches the registered job names exactly (case-sensitive)
  4. Inspect the dispatcher's job registry contents in a debug step to confirm what is registered

Example fix

// before
const dispatcher = createDispatcher(registry, { defaultDelegate: undefined });
// after
registry.register(defaultJob);
const dispatcher = createDispatcher(registry, { defaultDelegate: defaultJob.name });
Defensive patterns

Strategy: try-catch

Validate before calling

const registered = registry.getJobNames ? registry.getJobNames() : [];
if (!registered.includes(delegateName) && !defaultDelegate) {
  throw new Error(`No delegate job registered; register ${delegateName} or set defaultDelegate`);
}

Type guard

function hasDelegate(jobs, defaultDelegate) {
  return (Array.isArray(jobs) && jobs.length > 0) || !!defaultDelegate;
}

Try / catch

import { JobDoesNotExistException } from '@angular-devkit/architect';
try {
  const dispatcher = createDispatcher(registry, options);
} catch (e) {
  if (e instanceof JobDoesNotExistException) {
    console.error('Register delegate jobs (or a defaultDelegate) before dispatching');
  }
  throw e;
}

Prevention

When it happens

Trigger: Creating/dispatching a job via createDispatcher (or dispatcher job) when no registered job name matched the incoming argument and no defaultDelegate was provided to the JobRegistry/scheduler setup.

Common situations: Forgetting to register the delegate job(s) before dispatching; passing arguments that match no registered job's name/description; constructing a dispatcher without a default fallback in multi-job setups.

Related errors


AI-assisted analysis of angular/angular-cli@bb72145f9a (2026-08-30). Data as JSON: /api/errors/5ef92eb70e42bf56. Report an issue: GitHub.