Title: Error when running test with vitest after upgrading from v21.0 to v21.1 · Issue #32305 · angular/angular-cli · GitHub
Open Graph Title: Error when running test with vitest after upgrading from v21.0 to v21.1 · Issue #32305 · angular/angular-cli
X Title: Error when running test with vitest after upgrading from v21.0 to v21.1 · Issue #32305 · 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 21.0 Description With the latest v21.1.0 version, it's now impossible to run unit-test ...
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 21.0 Description With the latest v21.1.0 versio...
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 21.0 Description With the latest v21.1.0 versio...
Opengraph URL: https://github.com/angular/angular-cli/issues/32305
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Error when running test with vitest after upgrading from v21.0 to v21.1","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\n21.0\n\n### Description\n\nWith the latest v21.1.0 version, it's now impossible to run unit-test with vitest when there is scss assets in ng-package.json\nWhen running the command `ng test`, the CLI will stop with error\n```\nError: The {scss file listed in ng-package.json} asset path must start with the project source root. \n```\n\n### Minimal Reproduction\n\nI've created a repo with two tags:\n- [Working version 21.0](https://github.com/JulienMichelFr/repro-angular-library-vitest-bug/tree/v21.0)\n- [Not working version 21.1](https://github.com/JulienMichelFr/repro-angular-library-vitest-bug/tree/v21.1)\n\nYou just have to install and then run `ng test ui`\n\n### Exception or Error\n\n```text\nAn exception occurred while creating the test executor:\nError: The ./src/lib/theme.scss asset path must start with the project source root. \n at /{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/utils/normalize-asset-patterns.js:71:23 \n at Array.map (\u003canonymous\u003e) \n at normalizeAssetPatterns (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/utils/normalize-asset-patterns.js:64:26) \n at normalizeOptions (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/builders/application/options.js:77:46) \n at async buildApplicationInternal (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/builders/application/index.js:86:31) \n at async runBuildAndTest (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/builders/unit-test/builder.js:158:22) \n at async execute (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular/build/src/builders/unit-test/builder.js:330:13) \n at async handleAsyncIterator (/{path-to-repo}/repro-angular-library-vitest-bug/node_modules/@angular-devkit/architect/src/api.js:38:28)\n```\n\n### Your Environment\n\n```text\nAngular CLI : 21.1.0\nAngular : 21.1.0\nNode.js : 24.11.1\nPackage Manager : npm 11.7.0\nOperating System : linux x64\n\n┌───────────────────────────┬───────────────────┬───────────────────┐\n│ Package │ Installed Version │ Requested Version │\n├───────────────────────────┼───────────────────┼───────────────────┤\n│ @angular/build │ 21.1.0 │ 21.1.0 │\n│ @angular/cli │ 21.1.0 │ 21.1.0 │\n│ @angular/common │ 21.1.0 │ 21.1.0 │\n│ @angular/compiler │ 21.1.0 │ 21.1.0 │\n│ @angular/compiler-cli │ 21.1.0 │ 21.1.0 │\n│ @angular/core │ 21.1.0 │ 21.1.0 │\n│ @angular/forms │ 21.1.0 │ 21.1.0 │\n│ @angular/platform-browser │ 21.1.0 │ 21.1.0 │\n│ @angular/router │ 21.1.0 │ 21.1.0 │\n│ ng-packagr │ 21.1.0 │ 21.1.0 │\n│ rxjs │ 7.8.2 │ ~7.8.0 │\n│ typescript │ 5.9.3 │ ~5.9.2 │\n│ vitest │ 4.0.17 │ ^4.0.8 │\n└───────────────────────────┴───────────────────┴───────────────────┘\n```\n\n### Anything else relevant?\n\n_No response_","author":{"url":"https://github.com/JulienMichelFr","@type":"Person","name":"JulienMichelFr"},"datePublished":"2026-01-15T11:18:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/32305/angular-cli/issues/32305"}
| 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:1ff0944c-4b80-4f8d-e8aa-3f762664d094 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D94E:2E5741:B32089:E95F59:696B5B0A |
| html-safe-nonce | d704d1fe7326dc180dc902ca84608b618b10bdb2098f0d758bc6a349452c8856 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOTRFOjJFNTc0MTpCMzIwODk6RTk1RjU5OjY5NkI1QjBBIiwidmlzaXRvcl9pZCI6Ijc2MzM0NzQ0ODgyMzc3NzU2MjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 10db0bd9e94e6b55ef727717d4f3961d1aa3831cb68bf99a3e80b39f1881697b |
| hovercard-subject-tag | issue:3817115952 |
| 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/32305/issue_layout |
| twitter:image | https://opengraph.githubassets.com/479ca8121fbe469ce37a7b418d4c69fbb529524dcc565a0bda5e6a36480c242e/angular/angular-cli/issues/32305 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/479ca8121fbe469ce37a7b418d4c69fbb529524dcc565a0bda5e6a36480c242e/angular/angular-cli/issues/32305 |
| 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 21.0 Description With the latest v21.1.0 versio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JulienMichelFr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width