angular / angular/angular-cli

Tests don't run in Angular 16 using Jasmine/Karma

未关闭
#25,936 15 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
area: @ngtools/webpack freq1: low severity5: regression type: bug/fix
主要语言
TypeScript
星标
27k
派生
11.8k
平均合并
14 小时 23 分钟
30 天内合并 PR
162

描述

### Command

test

### Is this a regression?

- [X] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

15

### Description

The project compiles well, and the tests worked in version 15 of Angular. After running `ng test` I am receiving the following error:

`ng-virtual-main.js!=!data:text/javascript;base64 ...Unknown string like token - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): ...Unknown string like token s missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.`

### Minimal Reproduction

After running `ng test` I am receiving the following error:

`ng-virtual-main.js!=!data:text/javascript;base64 ...Unknown string like token - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): ...Unknown string like token s missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.`

### Exception or Error

```text
`ng-virtual-main.js!=!data:text/javascript;base64 ...Unkown string like token - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): ...Unkown string like token s missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.`
```

### Your Environment

```text
npm ls @ngtools/webpack

`└─┬ @angular-devkit/build-angular@16.2.4
└── @ngtools/webpack@16.2.4`

ng version

`Angular CLI: 16.2.4
Node: 18.15.0
Package Manager: npm 9.5.0
OS: linux x64

Angular: 16.2.7
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package Version
--------------------------------------------------------------
@angular-devkit/architect 0.1602.4
@angular-devkit/build-angular 16.2.4
@angular-devkit/core 16.2.4
@angular-devkit/schematics 16.2.4
@angular/cdk 16.2.6
@angular/cli 16.2.4
@angular/material 16.2.6
@angular/material-date-fns-adapter 16.2.6
@schematics/angular 16.2.4
rxjs 7.5.7
typescript 4.9.3
zone.js 0.13.3
`
```

### Anything else relevant?

_No response_

贡献指南

打开贡献指南

调研方向

使用 issue 中列出的 Angular CLI、Node 和 TypeScript 版本,通过 `ng test` 重现该失败。首先检查 `@ngtools/webpack/src/ivy/index.js` 和项目的 `tsconfig` 配置;当 Angular 16 测试在没有所报告的未知 token 或缺少编译错误的情况下运行时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
build-system, cli, testing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。