stencil-router icon indicating copy to clipboard operation
stencil-router copied to clipboard

App with stencil-router doesn't compile in Stencil 2.14+ because of TypeScript 4.5

Open cmaas opened this issue 2 years ago • 5 comments

Stencil version: 2.14 or higher

└── @stencil/[email protected]

I'm submitting a ... (check one with "x") [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com

Current behavior:

> stencil build

[15:45.9]  @stencil/core
[15:46.1]  v2.14.0 💫
[15:46.4]  build, app, prod mode, started ...
[15:46.4]  transpile started ...
[15:46.7]  transpile finished in 369 ms

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/compiler/lib.dom.d.ts:4482:101
           Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.Type 'HTMLElement |
           HTMLAppHomeElement | HTMLAppProfileElement | HTMLAppRootElement | HTMLAnchorElement | ... 74 more ... |
           HTMLTemplateElement' is not assignable to type 'Element'.Type 'HTMLStencilRouteLinkElement' is not
           assignable to type 'Element'.Property 'ariaLabel' is optional in type 'HTMLStencilRouteLinkElement' but
           required in type 'Element'.

   L4481:   */
   L4482:  TagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
   L4483:  getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/compiler/lib.dom.d.ts:4770:101
           Type 'HTMLElementTagNameMap[K]' does not satisfy the constraint 'Element'.Type 'HTMLElement |
           HTMLAppHomeElement | HTMLAppProfileElement | HTMLAppRootElement | HTMLAnchorElement | ... 74 more ... |
           HTMLTemplateElement' is not assignable to type 'Element'.

   L4769:  getElementsByClassName(classNames: string): HTMLCollectionOf<Element>;
   L4770:  TagName<K extends keyof HTMLElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<HTMLElementTagNameMap[K]>;
   L4771:  getElementsByTagName<K extends keyof SVGElementTagNameMap>(qualifiedName: K): HTMLCollectionOf<SVGElementTagNameMap[K]>;

[ ERROR ]  TypeScript: ./node_modules/@stencil/router/dist/types/components.d.ts:105:13
           Interface 'HTMLStencilRouteLinkElement' cannot simultaneously extend types 'StencilRouteLink' and
           'HTMLStencilElement'.Named property 'ariaLabel' of types 'StencilRouteLink' and 'HTMLStencilElement' are not
           identical.

    L105:    interface HTMLStencilRouteLinkElement extends Components.StencilRouteLink, HTMLStencilElement {}
    L106:    var HTMLStencilRouteLinkElement: {

[15:46.7]  build failed in 377 ms

Expected behavior: Should compile, like with Stencil 2.13.0

Steps to reproduce: Create a new Stencil starter 'app'. This has Stencil 2.13.0 as a dependency. Update to Stencil 2.14.0 or higher. Compile.

Related code: Presumably the same problem as with Ionicions / aria attributes: https://github.com/ionic-team/ionicons/issues/1011

Other information: No

cmaas avatar Apr 12 '22 12:04 cmaas

I have the same issue with @stencil/core 2.15.0

dario-baumberger avatar Apr 14 '22 10:04 dario-baumberger

I have the same issue with @stencil/core 2.15.0

same here

selodev avatar Apr 17 '22 08:04 selodev

Same problem. Is this package being maintained?

leegee avatar May 09 '22 09:05 leegee

Same problem :(

nazmulpro avatar Jun 06 '22 18:06 nazmulpro

In a different context but the same issue. Isn't it possible to change the TS version?

luckybusted avatar Feb 14 '23 15:02 luckybusted