{"record":{"id":"f62003015001981a","repo":"angular/angular","slug":"cannot-set-autodetect-to-false-with-zoneless-chang","errorCode":null,"errorMessage":"Cannot set autoDetect to false with zoneless change detection.","messagePattern":"Cannot set autoDetect to false with zoneless change detection\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/testing/src/component_fixture.ts","lineNumber":204,"sourceCode":"  /**\n   * Set whether the fixture should autodetect changes.\n   *\n   * Also runs detectChanges once so that any existing change is detected.\n   *\n   * @param autoDetect Whether to autodetect changes. By default, `true`.\n   * @deprecated For `autoDetect: true`, use `autoDetectChanges()`.\n   * We have not seen a use-case for `autoDetect: false` but `changeDetectorRef.detach()` is a close equivalent.\n   */\n  autoDetectChanges(autoDetect: boolean): void;\n  /**\n   * Enables automatically synchronizing the view, as it would in an application.\n   *\n   * Also runs detectChanges once so that any existing change is detected.\n   */\n  autoDetectChanges(): void;\n  autoDetectChanges(autoDetect = true): void {\n    if (!autoDetect && this.zonelessEnabled) {\n      throw new Error('Cannot set autoDetect to false with zoneless change detection.');\n    }\n    if (this._noZoneOptionIsSet && !this.zonelessEnabled) {\n      throw new Error('Cannot call autoDetectChanges when ComponentFixtureNoNgZone is set.');\n    }\n\n    if (autoDetect) {\n      this._testAppRef.autoDetectTestViews.add(this.componentRef.hostView);\n    } else {\n      this._testAppRef.autoDetectTestViews.delete(this.componentRef.hostView);\n    }\n\n    this.autoDetect = autoDetect;\n    this.detectChanges();\n  }\n\n  /**\n   * Return whether the fixture is currently stable or has async tasks that have not been completed\n   * yet.","sourceCodeStart":186,"sourceCodeEnd":222,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/core/testing/src/component_fixture.ts#L186-L222","documentation":"Error \"Cannot set autoDetect to false with zoneless change detection.\" thrown in angular/angular.","triggerScenarios":"Thrown at packages/core/testing/src/component_fixture.ts:204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not disable autoDetect with zoneless change detection; rely on signal-driven updates."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}