bug: TS2320: Interface 'HTMLIonInputElement' cannot simultaneously extend types 'IonInput' and 'HTMLStencilElement'
Prerequisites
- [x] I have read the Contributing Guidelines.
- [x] I agree to follow the Code of Conduct.
- [x] I have searched for existing issues that already report this problem, without success.
Ionic Framework Version
v8.x
Current Behavior
since angular 20.2.0 released 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 [email protected].* and [email protected].*
Expected Behavior
Success to build and serve
Steps to Reproduce
- update deps with [email protected] and [email protected]
- 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 😆
Facing same issue in new app.
{
"dependencies": {
"@angular/animations": "^20.0.0",
"@angular/common": "^20.0.0",
"@angular/compiler": "^20.0.0",
"@angular/core": "^20.0.0",
"@angular/forms": "^20.0.0",
"@angular/platform-browser": "^20.0.0",
"@angular/platform-browser-dynamic": "^20.0.0",
"@angular/router": "^20.0.0",
"@angular/service-worker": "^20.0.0",
"@capacitor/android": "7.4.3",
"@capacitor/app": "7.0.2",
"@capacitor/core": "7.4.3",
"@capacitor/haptics": "7.0.2",
"@capacitor/ios": "7.4.3",
"@capacitor/keyboard": "7.0.2",
"@capacitor/status-bar": "7.0.2",
"@ionic/angular": "^8.0.0",
"firebase-tools": "^14.14.0",
"ionicons": "^7.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^20.0.0",
"@angular-eslint/builder": "^20.0.0",
"@angular-eslint/eslint-plugin": "^20.0.0",
"@angular-eslint/eslint-plugin-template": "^20.0.0",
"@angular-eslint/schematics": "^20.0.0",
"@angular-eslint/template-parser": "^20.0.0",
"@angular/cli": "^20.0.0",
"@angular/compiler-cli": "^20.0.0",
"@angular/language-service": "^20.0.0",
"@capacitor/cli": "7.4.3",
"@ionic/angular-toolkit": "^12.0.0",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "^8.18.0",
"@typescript-eslint/parser": "^8.18.0",
"eslint": "^9.16.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^48.2.1",
"eslint-plugin-prefer-arrow": "1.2.3",
"jasmine-core": "5.9.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "5.9.2"
},
}
Hope we get fix soon. Message for the testing team, atleast test once before release.
FYI you can force a build by adding "skipLibCheck": true to your tsconfig.json's compilerOptions, but also hoping this gets resolved soon.
Facing same issue in new app
FYI you can force a build by adding
"skipLibCheck": falseto your tsconfig.json'scompilerOptions, but also hoping this gets resolved soon.
You need to add "skipLibCheck": true
You need to add
"skipLibCheck": true
Whoops, corrected.
Thanks for the issue!
You should be able to work around this by downgrading TypeScript:
npm i [email protected] --save-exact
Confirmed downgrade to [email protected] worked in my case. Thank you much!
This fixed the issue for me, works fine with [email protected] too. Thanks!
Hi everyone! I wanted to share an update on why this issue is happening, what needs to be done to resolve it, and what we recommend in the meantime.
Why this is happening
TypeScript 5.9 introduced a new property, HTMLElement.autocorrect, defined as a boolean. This conflicts with Stencil's existing autocorrect type, which follows the global autocorrect and is defined as a string.
Why this only affects Angular (not React or Vue)
Angular is currently the only framework that doesn't use skipLibCheck in its tsconfig.json in both our starters and our docs examples. React and Vue are not running into this because their configs already include skipLibCheck. I'll be updating the Angular starters and docs to include this as well.
What we are doing to fix it
The permanent fix needs to happen in Stencil. We've created an internal task to upgrade Stencil for TypeScript 5.9 support. We don't have an ETA until work begins, but once complete, we'll update Stencil in Ionic Framework and resolve this issue.
What we recommend in the meantime
If you want to use TypeScript 5.9, add the following to your tsconfig.json:
"compilerOptions": {
"skipLibCheck": true,
},
If you want to pin TypeScript to the last version that works, you can install it with:
npm i [email protected] --save-exact
We will update this issue once there is a permanent fix. Thank you!
FYI you can force a build by adding
"skipLibCheck": trueto your tsconfig.json'scompilerOptions, but also hoping this gets resolved soon.
cool, but what happens when there are actual issues with declaration files? Does this hide all issues?
looks like Stencil fixed it and upgraded to typescript 5.9
And the TS update was reverted because of Ionic: https://github.com/stenciljs/core/pull/6444
Small update -
We tried to resolve this after upgrading Stencil to TypeScript 5.9 by overriding the autocorrect type. When that introduced issues, we tried only omitting the autocorrect type instead. Unfortunately, both approaches caused issues for other Stencil projects and we had to revert the upgrade entirely.
At this point, the likely path forward is to update Ionic Framework's autocorrect type in Input and Searchbar to use a boolean. This will be a breaking change so we can't do this until Ionic Framework v9. However, we are actively working on v9 and the latest TypeScript support is still a top priority.