MSW fails to import when running unit tests in browser mode
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- angular, typescript
- Área
- build-system, testing
Línea de trabajo
Empieza reproduciendo la configuración indicada de pruebas unitarias de Angular 21 en modo navegador con Vitest y una importación desde msw; después, inspecciona cómo el ejecutor de pruebas unitarias de Angular pasa las condiciones de resolución. Se considera terminado cuando las pruebas en modo navegador pueden importar msw sin el error de externalización del punto de entrada, mientras el comportamiento de jsdom permanece sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 27k
- Forks
- 11.8k
- Merge medio
- 16 h 21 min
- PR fusionados (30 d)
- 170
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angular-cli
-
Can't use an array of hostnames in --allowedHosts cli parameter in @angular/build:dev-server Abiertoarea: @angular/build gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
angular/angular-cli#33055 · 1 comentario · 3 reacciones ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 1 asignado ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 1 asignado ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 1 asignado ·
Todos los issues de angular/angular-cli
Issues similares
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 95/100
-
Ecosystem: ClawMetry — the Qwen Code reader is now free and open source (follow-up to #9294 / #9338) Abiertocategory/integration priority/P3 scope/documentation status/ready-for-human type/feature-request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
-
area:auth FE mvp P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
klasolsson81/jobbliggaren#1788 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
get-convex/migrations#69 ·
-
accessibility angular bug good first issue typescript ux
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/fineract-backoffice-ui#584 · 1 comentario ·