Stencil: `npm run build` is broken at type checking step

Created on 28 Oct 2019  路  12Comments  路  Source: ionic-team/stencil

Stencil version:

 @stencil/[email protected]

I'm submitting a:

[x] bug report

Current behavior:
Running npm run build fails because of the following typescript type checking error:

[ ERROR ]  TypeScript: node_modules/@stencil/core/dist/declarations/testing.d.ts:4:19
           All declarations of 'Matchers' must have identical type parameters.

      L3:  namespace jest {
      L4:      interface Matchers<R> {
      L5:          /**

[ ERROR ]  TypeScript: node_modules/@types/jest/index.d.ts:639:15
           All declarations of 'Matchers' must have identical type parameters.

    L638:  // should be R extends void|Promise<void> but getting dtslint error
    L639:  interface Matchers<R, T> {
    L640:      /**

Expected behavior:

npm run build should succeed in an application without errors.

Steps to reproduce:

Just starting a new stencil application or component and updating @stencil/core to 1.7.4 will do it.

triage

Most helpful comment

I tried to update to 1.7.5 but also updated jest, jest types and jest-cli

"devDependencies": {
    "@stencil/core": "^1.7.5",
    "@types/d3": "^5.7.1",
    "@types/jest": "24.0.20",
    "@types/puppeteer": "1.20.2",
    "jest": "24.9.0",
    "jest-cli": "24.9.0",
    "puppeteer": "1.20.0"
  }

And now it works :)

All 12 comments

fixed it as part of a PR i was hoping to get merged. very small change in a type declaration file: https://github.com/ionic-team/stencil/pull/1971/commits/17d6845527822809891da713e058e9639cf49c33

Thanks @vidarc !

But i can't find your commit anywhere, not in the master branch nor any PR, is it normal ?

Any news about this?

@kaeh just sitting in a PR of mine. This one: https://github.com/ionic-team/stencil/pull/1971

Same thing I did, so I assume so

1.7.5 does not fix this issue for me:

[28:29.2]  @stencil/core v1.7.5 馃殠
[28:29.3]  build, lime-elements, dev mode, started ...
[28:30.1]  transpile started ...
[28:36.7]  transpile finished in 6.58 s
[28:36.7]  type checking started ...
[28:36.7]  copy started ...
[28:36.7]  generate styles started ...
[28:36.8]  bundling components started ...
[28:59.2]  type checking finished in 22.53 s

[ ERROR ]  TypeScript: node_modules/@stencil/core/dist/declarations/testing.d.ts:4:19
           All declarations of 'Matchers' must have identical type
           parameters.

      L3:  namespace jest {
      L4:      interface Matchers<R, T> {
      L5:          /**

[ ERROR ]  TypeScript: node_modules/@types/jest/index.d.ts:531:31
           Generic type 'Matchers<R, T>' requires 2 type argument(s).

    L530:   */
    L531:  <T = any>(actual: T): Matchers<T>;
    L532:  /**

[ ERROR ]  TypeScript: node_modules/@types/jest/index.d.ts:606:15
           All declarations of 'Matchers' must have identical type
           parameters.

    L606:      interface Matchers<R> {
    L607:          /**

Weird, have you tried to clean your node_modules and your cache, just in case, before updating / installing?

I'm not at work yet, I'll try ASAP and keep you up.
Maybe there is another type file to update 馃

I've just run npm i, but it did fail in our CI environment as well. I'll try emptying node_modules and the cache.

Edit: Nope, I still get the same three errors 馃槙

Btw, this isn't a panic for us, we're running 1.7.3 and it's working just fine.

I tried to update to 1.7.5 but also updated jest, jest types and jest-cli

"devDependencies": {
    "@stencil/core": "^1.7.5",
    "@types/d3": "^5.7.1",
    "@types/jest": "24.0.20",
    "@types/puppeteer": "1.20.2",
    "jest": "24.9.0",
    "jest-cli": "24.9.0",
    "puppeteer": "1.20.0"
  }

And now it works :)

Yes, that worked. Thank you!

You're welcome, have a nice day :)

Edit : I think the issue can be closed for the 1.7.5

Was this page helpful?
0 / 5 - 0 ratings