Title: Many NG0100 errors in Karma unit tests after updating to Angular 21 · Issue #32047 · angular/angular-cli · GitHub
Open Graph Title: Many NG0100 errors in Karma unit tests after updating to Angular 21 · Issue #32047 · angular/angular-cli
X Title: Many NG0100 errors in Karma unit tests after updating to Angular 21 · Issue #32047 · angular/angular-cli
Description: Command test Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.3.12 Description When updating my app to Angular 21, all is fine, except my unit tes...
Open Graph Description: Command test Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.3.12 Description When updating my app to Ang...
X Description: Command test Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.3.12 Description When updating my app to Ang...
Opengraph URL: https://github.com/angular/angular-cli/issues/32047
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Many NG0100 errors in Karma unit tests after updating to Angular 21","articleBody":"### Command\n\ntest\n\n### Is this a regression?\n\n- [x] Yes, this behavior used to work in the previous version\n\n### The previous version in which this bug was not present was\n\n20.3.12\n\n### Description\n\nWhen updating my app to Angular 21, all is fine, _except_ my unit tests. There are now many, many occurrences of the `NG0100: ExpressionChangedAfterItHasBeenCheckedError`, which were not present before the update.\n\nMy app still heavily relies on zone.js for change detection. I also still use the older `@angular-devkit/build-angular:karma` builder. I am working on upgrading both, but that process is gradual and will still take significant effort.\n\nI discovered [this Reddit post](https://www.reddit.com/r/angular/comments/1p8suok/upgrading_from_angular_20_21_app_works_but_tests/) where someone describes the exact same issue (in way more detail). This also includes a workaround: globally \"patch\" `TestBed.configureTestingModule` to always `provideZoneChangeDetection()`. As I also indicated in my comment over there, this does work, but feels too hacky and I cannot imagine this being the \"official\" recommended solution. Is there anything else I can do?\n\n### Minimal Reproduction\n\nIn principle:\n1. Have a zone.js-based Angular project, not using OnPush change detection (at least not everywhere)\n2. Run `ng test`\n3. Observe NG0100 errors\n\nI am unfortunately unable to submit (parts of) my actual source code. Will try to see if I can make a minimal reproduction later.\n\n### Exception or Error\n\n```text\nNG0100: ExpressionChangedAfterItHasBeenCheckedError\n```\n\n### Your Environment\n\n```text\n_ _ ____ _ ___\n / \\ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|\n / △ \\ | '_ \\ / _` | | | | |/ _` | '__| | | | | | |\n / ___ \\| | | | (_| | |_| | | (_| | | | |___| |___ | |\n /_/ \\_\\_| |_|\\__, |\\__,_|_|\\__,_|_| \\____|_____|___|\n |___/\n \n\nAngular CLI : 21.0.1\nAngular : 21.0.2\nNode.js : 24.11.0\nPackage Manager : yarn 4.12.0\nOperating System : darwin arm64\n\n┌────────────────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├────────────────────────────────────┼───────────────────┼───────────────────┤\n│ @angular-devkit/architect │ 0.2100.1 │ 0.2100.1 │\n│ @angular-devkit/build-angular │ 21.0.1 │ 21.0.1 │\n│ @angular-devkit/core │ 21.0.1 │ 21.0.1 │\n│ @angular-devkit/schematics │ 21.0.1 │ 21.0.1 │\n│ @angular/animations │ 21.0.2 │ 21.0.2 │\n│ @angular/cdk │ 21.0.1 │ 21.0.1 │\n│ @angular/cli │ 21.0.1 │ 21.0.1 │\n│ @angular/common │ 21.0.2 │ 21.0.2 │\n│ @angular/compiler │ 21.0.2 │ 21.0.2 │\n│ @angular/compiler-cli │ 21.0.2 │ 21.0.2 │\n│ @angular/core │ 21.0.2 │ 21.0.2 │\n│ @angular/forms │ 21.0.2 │ 21.0.2 │\n│ @angular/language-service │ 21.0.2 │ 21.0.2 │\n│ @angular/material │ 21.0.1 │ 21.0.1 │\n│ @angular/material-date-fns-adapter │ 21.0.1 │ 21.0.1 │\n│ @angular/platform-browser │ 21.0.2 │ 21.0.2 │\n│ @angular/platform-browser-dynamic │ 21.0.2 │ 21.0.2 │\n│ @angular/router │ 21.0.2 │ 21.0.2 │\n│ rxjs │ 7.8.2 │ 7.8.2 │\n│ typescript │ 5.9.3 │ 5.9.3 │\n│ zone.js │ 0.15.1 │ 0.15.1 │\n└────────────────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/jimivdw","@type":"Person","name":"jimivdw"},"datePublished":"2025-12-05T12:44:34Z","url":"https://github.com/angular/angular-cli/issues/32047"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:72ddd4db-cfe5-f995-ac5c-4fcc7c784a64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E638:1148D3:3407530:426A7A4:6B01E3F7 |
| html-safe-nonce | 16679e7d941e7ed6cdb4f13af90bc411d6e053f1ebf0dbf105fb7cc117963ea5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjM4OjExNDhEMzozNDA3NTMwOjQyNkE3QTQ6NkIwMUUzRjciLCJ2aXNpdG9yX2lkIjoiMzI4MjgzNjcxOTUyNjg2Mzg2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fea63c07e27af9783d564797e65135275c01ce17519396d9968091ce62a73718 |
| hovercard-subject-tag | issue:3699619301 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/32047/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b4355d5782d68c6e386f5e635fcee32fba738e8f6a8b7c2c76dbdc6e731d5404/angular/angular-cli/issues/32047 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b4355d5782d68c6e386f5e635fcee32fba738e8f6a8b7c2c76dbdc6e731d5404/angular/angular-cli/issues/32047 |
| og:image:alt | Command test Is this a regression? Yes, this behavior used to work in the previous version The previous version in which this bug was not present was 20.3.12 Description When updating my app to Ang... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jimivdw |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width