Skip to content

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

Done

Description

@emeryao

Prerequisites

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

  1. update deps with [email protected] and [email protected]
  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 😆

Activity

  1. IAM5K commented on Aug 23, 2025

    @IAM5K
    Image

    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.

  2. loganmurray-infor commented on Aug 25, 2025

    @loganmurray-infor

    FYI you can force a build by adding "skipLibCheck": true to your tsconfig.json's compilerOptions, but also hoping this gets resolved soon.

  3. pedrodominguesp commented on Aug 25, 2025

    @pedrodominguesp

    Facing same issue in new app

  4. davidsarkany commented on Aug 26, 2025

    @davidsarkany

    FYI you can force a build by adding "skipLibCheck": false to your tsconfig.json's compilerOptions, but also hoping this gets resolved soon.

    You need to add "skipLibCheck": true

  5. loganmurray-infor commented on Aug 26, 2025

    @loganmurray-infor

    You need to add "skipLibCheck": true

    Whoops, corrected.

  6. added
    package: angular
    type: bug
    on Aug 28, 2025
  7. brandyscarney commented on Aug 28, 2025

    @brandyscarney
    Member

    Thanks for the issue!

    You should be able to work around this by downgrading TypeScript:

    npm i [email protected] --save-exact
  8. brysonreese commented on Aug 28, 2025

    @brysonreese

    Confirmed downgrade to [email protected] worked in my case. Thank you much!

  9. SoraNoIseki commented on Sep 3, 2025

    @SoraNoIseki

    This fixed the issue for me, works fine with [email protected] too. Thanks!

  10. added
    stencil
    and removed
    package: angular
    on Sep 4, 2025
  11. brandyscarney commented on Sep 4, 2025

    @brandyscarney
    Member

    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!

  12. snolan-ethika commented on Sep 10, 2025

    @snolan-ethika

    FYI you can force a build by adding "skipLibCheck": true to your tsconfig.json's compilerOptions, but also hoping this gets resolved soon.

    cool, but what happens when there are actual issues with declaration files? Does this hide all issues?

  13. lecousin commented on Nov 14, 2025

    @lecousin

    looks like Stencil fixed it and upgraded to typescript 5.9

  14. hakimio commented on Nov 14, 2025

    @hakimio

    And the TS update was reverted because of Ionic: stenciljs/core#6444

  15. brandyscarney commented on Nov 14, 2025

    @brandyscarney
    Member

    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.

  16. andreElrico commented on May 18, 2026

    @andreElrico

    I worked around this issue by overwriting the files for now:

    // stencil-fix.d.ts

    import '@ionic/core'; // Ensures the global Ionic/Stencil types are loaded first
    
    /**
     * ⚠️ TEMPORARY FIX FOR IONIC / STENCIL COMPILER CLASH (TS2320)
     * 
     * Tracking Issue: https://github.com/ionic-team/ionic-framework/issues/30650
     * 
     * Context: 
     * The Angular esbuild compiler plugin actively checks template files and 
     * bypasses the standard `skipLibCheck: true` flag in tsconfig. This exposes 
     * a multiple-inheritance conflict in Ionic's internal types:
     * - Parent 1 (`HTMLStencilElement`) types `autocorrect` as `string`.
     * - Parent 2 (`IonInput` / `IonSearchbar`) types it strictly as `'on' | 'off'`.
     * 
     * Why this specific fix:
     * We cannot use `string` or `'on' | 'off'` here because TypeScript refuses to let a 
     * child broaden or violate conflicting parent rules. By setting `autocorrect: any` 
     * directly on the child interfaces, `any` acts as a universal adapter that satisfies 
     * both parents simultaneously.
     * 
     * This surgical approach is preferred because it silences the compilation error 
     * without resorting to wiping out strict typing for the entire `<ion-input>` JSX element.
     */
    declare global {
      // This explicitly targets ONLY the conflicting property on the specific elements.
      // All other properties (value, disabled, type, etc.) remain 100% strictly typed!
      interface HTMLIonInputElement {
        autocorrect: any;
      }
    
      interface HTMLIonSearchbarElement {
        autocorrect: any;
      }
    }
    

    make sure to include in tsconfig.

  17. IAM5K commented on May 22, 2026

    @IAM5K

    Wokarounds only help in local, it often creates issue with the procuction ci cd pipeline

  18. hakimio commented on May 22, 2026

    @hakimio

    @IAM5K at least bun and pnpm package managers have patch command to patch 3rd party dependencies.

  19. thetaPC commented on Nov 26, 2026

    @thetaPC
    Contributor

    Thanks for the report, and sorry for the delay.

    Verified on 9.0.13. #31185 fixed it in v9.0.0, so updating to 9.0.0 or later resolves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stenciltype: bug

    Type

    Fields

    Stage

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions