Title: NG 21 + Vitest + Non-stadanlone component with async pipe · Issue #65665 · angular/angular · GitHub
Open Graph Title: NG 21 + Vitest + Non-stadanlone component with async pipe · Issue #65665 · angular/angular
X Title: NG 21 + Vitest + Non-stadanlone component with async pipe · Issue #65665 · angular/angular
Description: Which @angular/* package(s) are the source of the bug? common Is this a regression? Yes Description With Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. I get the following error: X [ERROR] NG8004:...
Open Graph Description: Which @angular/* package(s) are the source of the bug? common Is this a regression? Yes Description With Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. I ge...
X Description: Which @angular/* package(s) are the source of the bug? common Is this a regression? Yes Description With Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. ...
Opengraph URL: https://github.com/angular/angular/issues/65665
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"NG 21 + Vitest + Non-stadanlone component with async pipe","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncommon\n\n### Is this a regression?\n\nYes\n\n### Description\n\nWith Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. I get the following error:\n\n```\nX [ERROR] NG8004: No pipe found with name 'async'.\nTo fix this, import the \"AsyncPipe\" class from \"@angular/common\" and add it to the \"imports\" array of the module declaring the component. [plugin angular-compiler] \n\n src/app/async-test/async-test.html:1:9:\n 1 │ \u003cp>{{v | async }}\u003c/p>\n ╵ ~~~~~ \n\n Error occurs in the template of component AsyncTestComponent.\n\n src/app/async-test/async-test.ts:6:15:\n 6 │ templateUrl: './async-test.html',\n ╵ ~~~~~~~~~~~~~~~~~~~ \n```\n\nHere is the full code:\n\nTest\n```\ndescribe('AsyncTestComponent', () => {\n let component: AsyncTestComponent;\n let fixture: ComponentFixture\u003cAsyncTestComponent>;\n\n beforeEach(async () => {\n await TestBed.configureTestingModule({\n imports: [CommonModule, AsyncPipe ],\n declarations: [AsyncTestComponent]\n })\n .compileComponents();\n\n fixture = TestBed.createComponent(AsyncTestComponent);\n component = fixture.componentInstance;\n await fixture.whenStable();\n });\n\n it('should create', () => {\n expect(component).toBeTruthy();\n });\n});\n```\n\nComponent:\n```\n@Component({\n selector: 'app-async-test',\n templateUrl: './async-test.html',\n styleUrl: './async-test.css',\n standalone: false\n})\nexport class AsyncTestComponent {\n protected readonly v = of(1);\n}\n```\n\nHTML:\n```\n\u003cp>{{v | async }}\u003c/p>\n```\n\n\n### Please provide a link to a minimal reproduction of the bug\n\nng new --> add a non standalone component and use the async pipe in it then run ng test\n\n### Please provide the exception or error you saw\n\n```true\nI should be able to test my non-stadanlone component (using AsyncPipe) in angular 21.\n```\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\n```true\nAngular CLI : 21.0.0\nAngular : 21.0.0\nNode.js : 22.16.0\nPackage Manager : npm 10.9.2\nOperating System : win32 x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 21.0.0 │ ^21.0.0 │\n│ @angular/cli │ 21.0.0 │ ^21.0.0 │\n│ @angular/common │ 21.0.0 │ ^21.0.0 │\n│ @angular/compiler │ 21.0.0 │ ^21.0.0 │\n│ @angular/compiler-cli │ 21.0.0 │ ^21.0.0 │\n│ @angular/core │ 21.0.0 │ ^21.0.0 │\n│ @angular/forms │ 21.0.0 │ ^21.0.0 │\n│ @angular/platform-browser │ 21.0.0 │ ^21.0.0 │\n│ @angular/router │ 21.0.0 │ ^21.0.0 │\n│ rxjs │ 7.8.2 │ ~7.8.0 │\n│ typescript │ 5.9.3 │ ~5.9.2 │\n│ vitest │ 4.0.13 │ ^4.0.8 │\n└───────────────────────────┴───────────────────┴───────────────────\n```\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/Scipionh","@type":"Person","name":"Scipionh"},"datePublished":"2025-11-26T12:51:28Z","url":"https://github.com/angular/angular/issues/65665"}
| 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:341132f7-99e3-91b4-1b91-f32bfd140c50 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E60:3DCD28:109E732:161541D:6B01E147 |
| html-safe-nonce | 672b5ea82c942b3a444434824058cf0e5b93f92076b7de5b8a7e6ef08038e4e1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTYwOjNEQ0QyODoxMDlFNzMyOjE2MTU0MUQ6NkIwMUUxNDciLCJ2aXNpdG9yX2lkIjoiMTIxOTEyMDU1ODg4OTg4NjAyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d254c53b4303e9711c5366e59f4ab4b3b9b143752cea26fe107295cded7c50f0 |
| hovercard-subject-tag | issue:3667390784 |
| 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/65665/issue_layout |
| twitter:image | https://opengraph.githubassets.com/930175accd5f22a199d946b888ca68b1916101aba2284adbefe5d12b684ca04d/angular/angular/issues/65665 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/930175accd5f22a199d946b888ca68b1916101aba2284adbefe5d12b684ca04d/angular/angular/issues/65665 |
| og:image:alt | Which @angular/* package(s) are the source of the bug? common Is this a regression? Yes Description With Angular 21, I can't test (with vitest) a non-standalone component using the Async pipe. I ge... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Scipionh |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular git https://github.com/angular/angular.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 24195339 |
| octolytics-dimension-repository_nwo | angular/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24195339 |
| octolytics-dimension-repository_network_root_nwo | angular/angular |
| 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