MSW fails to import when running unit tests in browser mode
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- angular, typescript
- 領域
- build-system, testing
調査の方向性
まず、Vitest と msw からの import を使って、記載されている Angular 21 のブラウザーモードのユニットテスト設定を再現します。次に、Angular のユニットテストランナーが resolve conditions をどのように渡しているかを調べます。ブラウザーモードのテストで entry-point externalization error が発生せずに msw を import でき、jsdom の動作が変わらない状態になれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
Yes
Description
In Angular 21, when running unit tests using the below configuration the run fails with "The entry point "msw" cannot be marked as external"
Setup:
- Create a new angular project.
- Set unit tests to use the chromium browser
- Install MSW
- Attempt to import anything from
mswin a test case, the above error is thrown.
This appears to be related to a disconnect between the package.json configuration of MSW and the "resolve conditions" that are being passed to Vitest by the angular unit test runner.
When running the tests in jsdom (not browser) we do not encounter this issue.
Please provide a link to a minimal reproduction of the bug
No response
Please provide the exception or error you saw
Please provide the environment you discovered this bug in (run ng version)
Angular CLI : 21.1.4
Angular : 21.1.5
Node.js : 22.18.0
Package Manager : npm 11.5.2
Operating System : win32 x64
┌───────────────────────────┬───────────────────┬───────────────────┐
│ Package │ Installed Version │ Requested Version │
├───────────────────────────┼───────────────────┼───────────────────┤
│ @angular/build │ 21.1.4 │ ^21.1.4 │
│ @angular/cli │ 21.1.4 │ ^21.1.4 │
│ @angular/common │ 21.1.5 │ ^21.1.0 │
│ @angular/compiler │ 21.1.5 │ ^21.1.0 │
│ @angular/compiler-cli │ 21.1.5 │ ^21.1.0 │
│ @angular/core │ 21.1.5 │ ^21.1.0 │
│ @angular/forms │ 21.1.5 │ ^21.1.0 │
│ @angular/platform-browser │ 21.1.5 │ ^21.1.0 │
│ @angular/router │ 21.1.5 │ ^21.1.0 │
│ rxjs │ 7.8.2 │ ~7.8.0 │
│ typescript │ 5.9.3 │ ~5.9.2 │
│ vitest │ 4.0.18 │ ^4.0.8 │
└───────────────────────────┴───────────────────┴───────────────────┘
Anything else?
No response
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 11.8k
- 平均マージ
- 16時間 21分
- マージ済み PR(30日)
- 170
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
angular/angular-cli のほかの issue
-
area: @angular/build gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
angular/angular-cli#33055 · コメント 1 件 · リアクション 3 件 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 担当者 1 名 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 担当者 1 名 ·
angular/angular-cli の issue をすべて見る
似ている issue
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) オープンcategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
area:auth FE mvp P3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
klasolsson81/jobbliggaren#1788 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
get-convex/migrations#69 ·
-
accessibility angular bug good first issue typescript ux
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
apache/fineract-backoffice-ui#584 · コメント 1 件 ·