feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.98k stars 743 forks source link

typescript npm run compile failing for tutorial feathers-chat #3226

Closed diegofhe closed 1 year ago

diegofhe commented 1 year ago

Steps to reproduce

Follow the guide for the chat app

Steps:

  1. npm create feathers@latest feathers-chat
  2. cd feathers-chat
  3. npm i
  4. npm run compile

Expected behavior

To compile successfully

Actual behavior

$ npm run compile

> feathers-chat-ts@0.0.0 compile
> shx rm -rf lib/ && tsc

../../../../../../node_modules/@types/jest/index.d.ts:25:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'beforeEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

25 declare var beforeEach: jest.Lifecycle;
               ~~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2650:13
    2650 declare var beforeEach: Mocha.HookFunction;
                     ~~~~~~~~~~
    'beforeEach' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:27:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'afterEach' must be of type 'HookFunction', but here has type 'Lifecycle'.

27 declare var afterEach: jest.Lifecycle;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2668:13
    2668 declare var afterEach: Mocha.HookFunction;
                     ~~~~~~~~~
    'afterEach' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:28:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'describe' must be of type 'SuiteFunction', but here has type 'Describe'.

28 declare var describe: jest.Describe;
               ~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2684:13
    2684 declare var describe: Mocha.SuiteFunction;
                     ~~~~~~~~
    'describe' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:30:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xdescribe' must be of type 'PendingSuiteFunction', but here has type 'Describe'.

30 declare var xdescribe: jest.Describe;
               ~~~~~~~~~

  node_modules/@types/mocha/index.d.ts:2705:13
    2705 declare var xdescribe: Mocha.PendingSuiteFunction;
                     ~~~~~~~~~
    'xdescribe' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:31:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'it' must be of type 'TestFunction', but here has type 'It'.

31 declare var it: jest.It;
               ~~

  node_modules/@types/mocha/index.d.ts:2719:13
    2719 declare var it: Mocha.TestFunction;
                     ~~
    'it' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:33:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'xit' must be of type 'PendingTestFunction', but here has type 'It'.

33 declare var xit: jest.It;
               ~~~

  node_modules/@types/mocha/index.d.ts:2740:13
    2740 declare var xit: Mocha.PendingTestFunction;
                     ~~~
    'xit' was also declared here.

../../../../../../node_modules/@types/jest/index.d.ts:34:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'test' must be of type 'TestFunction', but here has type 'It'.

34 declare var test: jest.It;
               ~~~~

  node_modules/@types/mocha/index.d.ts:2733:13
    2733 declare var test: Mocha.TestFunction;
                     ~~~~
    'test' was also declared here.

../../../../../../node_modules/@types/react-dom/index.d.ts:16:19 - error TS2724: '"react"' has no exported member named 'SFCElement'. Did you mean 'CElement'?

16     ReactElement, SFCElement, CElement,
                     ~~~~~~~~~~

Found 8 errors in 2 files.

Errors  Files
     7  ../../../../../../node_modules/@types/jest/index.d.ts:25
     1  ../../../../../../node_modules/@types/react-dom/index.d.ts:16

System configuration

Node: v20.3.0 Operating system: Mac Ventura 13.4 (22F66) npm v9.6.7

daffl commented 1 year ago

I am not able to reproduce this. A standard app setup does not include Jest so I'm not sure where that error might be coming from.