ionic-team / ionic-team/ionic-framework

bug: TS2320: Interface 'HTMLIonInputElement' cannot simultaneously extend types 'IonInput' and 'HTMLStencilElement'

未关闭
#30,650 16 条评论 29 个 reaction 已指派 0 人 在 GitHub 查看
stencil type: bug
主要语言
TypeScript
星标
52.7k
派生
13.3k
平均合并
1 天 15 小时
30 天内合并 PR
51

描述

### Prerequisites

- [x] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#creating-an-issue).
- [x] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [x] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v8.x

### Current Behavior

since angular 20.2.0 [released](https://github.com/angular/angular/releases/tag/20.2.0) recently and typescript v5.9 is being supported

I upgraded dependencies of my project and the message pop up when serving the project

```
X [ERROR] TS2320: Interface 'HTMLIonInputElement' cannot simultaneously extend types 'IonInput' and 'HTMLStencilElement'.
Named property 'autocorrect' of types 'IonInput' and 'HTMLStencilElement' are not identical. [plugin angular-compiler]

node_modules/@ionic/core/dist/types/components.d.ts:4326:14:
4326 │ interface HTMLIonInputElement extends Components.IonInput, H...

X [ERROR] TS2320: Interface 'HTMLIonSearchbarElement' cannot simultaneously extend types 'IonSearchbar' and 'HTMLStencilElement'.
Named property 'autocorrect' of types 'IonSearchbar' and 'HTMLStencilElement' are not identical. [plugin angular-compiler]

node_modules/@ionic/core/dist/types/components.d.ts:4888:14:
4888 │ interface HTMLIonSearchbarElement extends Components.IonSear...
```

and my project went well with angular@v20.1.* and typescript@v5.8.*

### Expected Behavior

Success to build and serve

### Steps to Reproduce

1. update deps with angular@v20.2.0 and typescript@v5.9.2
2. try to serve with `npx ng serve`

### Ionic Info

Ionic:

Ionic CLI : 7.2.1 (C:\Users\USER\AppData\Local\npm-cache\_npx\f6fddb685269761d\node_modules\@ionic\cli)
Ionic Framework : @ionic/angular 8.7.2
@angular-devkit/build-angular : not installed
@angular-devkit/schematics : 20.2.0
@angular/cli : 20.2.0
@ionic/angular-toolkit : not installed

Capacitor:

Capacitor CLI : 7.4.2
@capacitor/android : 7.4.2
@capacitor/core : 7.4.2
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v24.6.0 (C:\Program Files\nodejs\node.exe)
npm : 11.5.2
OS : Windows 10

---

Sorry for my poor English 😆

贡献指南

打开贡献指南

调研方向

Start by reproducing the issue with Angular 20.2.0, TypeScript 5.9.2, and `npx ng serve`. Inspect the declarations around lines 4326 and 4888 in `node_modules/@ionic/core/dist/types/components.d.ts`, where the reported interface conflicts occur. Done means the project builds and serves without the TS2320 errors.

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

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
52/100

把新 issue 发到你的邮箱

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