{"record":{"id":"e0194529a654f7de","repo":"angular/angular","slug":"209","errorCode":"-209","errorMessage":"Unexpected type of the `APP_INITIALIZER` token value (expected an array, but got ${typeof this.appInits}). Please check that the `APP_INITIALIZER` token is configured as a `multi: true` provider.","messagePattern":"Unexpected type of the `APP_INITIALIZER` token value \\(expected an array, but got (.+?)\\)\\. Please check that the `APP_INITIALIZER` token is configured as a `multi: true` provider\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"critical","filePath":"packages/core/src/application/application_init.ts","lineNumber":228,"sourceCode":"export class ApplicationInitStatus {\n  // Using non null assertion, these fields are defined below\n  // within the `new Promise` callback (synchronously).\n  private resolve!: (...args: any[]) => void;\n  private reject!: (...args: any[]) => void;\n\n  private initialized = false;\n  public readonly done = false;\n  public readonly donePromise: Promise<any> = new Promise((res, rej) => {\n    this.resolve = res;\n    this.reject = rej;\n  });\n\n  private readonly appInits = inject(APP_INITIALIZER, {optional: true}) ?? [];\n  private readonly injector = inject(Injector);\n\n  constructor() {\n    if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) {\n      throw new RuntimeError(\n        RuntimeErrorCode.INVALID_MULTI_PROVIDER,\n        'Unexpected type of the `APP_INITIALIZER` token value ' +\n          `(expected an array, but got ${typeof this.appInits}). ` +\n          'Please check that the `APP_INITIALIZER` token is configured as a ' +\n          '`multi: true` provider.',\n      );\n    }\n  }\n\n  /** @internal */\n  runInitializers() {\n    if (this.initialized) {\n      return;\n    }\n\n    const asyncInitPromises = [];\n    for (const appInits of this.appInits) {\n      const initResult = runInInjectionContext(this.injector, appInits);","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/core/src/application/application_init.ts#L210-L246","documentation":"ApplicationInitStatus injects APP_INITIALIZER with {optional: true} and expects an array, which is what a multi: true provider produces. In development mode its constructor verifies Array.isArray; providing the token without multi: true yields a single function (typeof 'function'), the array check fails, and RuntimeError -209 explains the misconfiguration.","triggerScenarios":"Registering {provide: APP_INITIALIZER, useFactory: ...} (or useValue/useClass) without multi: true in any provider array of the bootstrapped app/platform. The check runs in the ApplicationInitStatus constructor during bootstrap, so the app fails at startup in dev mode.","commonSituations":"First-time APP_INITIALIZER usage forgetting multi: true; adding a second initializer and refactoring both into one non-multi provider; copy-pasted config from older docs; library configs (e.g. APP initialization in NgModules) missing the flag. Note the guard is dev-mode only, so production builds skip the explicit error but initialization still misbehaves.","solutions":["Add multi: true to the APP_INITIALIZER provider entry.","Register each initializer as its own provider entry, all with multi: true.","Ensure the factory/value returns a function returning a Promise (or void); the multi flag is about the array, the return shape about awaiting.","After fixing, restart ng serve / rebuild to re-run bootstrap."],"exampleFix":"// before\nproviders: [\n  {provide: APP_INITIALIZER, useFactory: () => initApp},\n]\n\n// after\nproviders: [\n  {provide: APP_INITIALIZER, multi: true, useFactory: () => initApp},\n]","handlingStrategy":"validation","validationCode":"// Static check over provider arrays (dev tooling):\nfunction assertAppInitializersMulti(providers: Provider[]): void {\n  for (const p of providers) {\n    if (p && typeof p === 'object' && 'provide' in p && (p as any).provide === APP_INITIALIZER) {\n      if (!(p as any).multi) {\n        throw new Error('APP_INITIALIZER must be registered with multi: true');\n      }\n    }\n  }\n}","typeGuard":"export function isMultiProvider(p: Provider): boolean {\n  return typeof p === 'object' && p !== null && 'provide' in p &&\n    (p as {multi?: boolean}).multi === true;\n}","tryCatchPattern":null,"preventionTips":["Every APP_INITIALIZER provider entry gets multi: true; one entry per initializer.","Review provider arrays in a lint/grep pass for the token without multi.","Smoke-test bootstrap in dev mode: the explicit error only fires when ngDevMode is active."],"tags":["di","app-initializer","bootstrap","provider-config","runtime-error"],"backgroundTag":"multi-provider-misconfigured","analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}