Angular-cli: Cannot find type definition file for 'chai'.

Created on 8 Nov 2016  路  19Comments  路  Source: angular/angular-cli

OS?

Ubuntu 16.04

Versions.

angular-cli: 1.0.0-beta.19-3
node: 6.7.0
os: linux x64

Repro steps.

The log given by the failure.

wunder@Code-VirtualBox:~/projects/angular2-firebase-material-demo$ npm start

> [email protected] start /home/wunder/projects/angular2-firebase-material-demo
> ng serve --host 0.0.0.0

** NG Live Development Server is running on http://0.0.0.0:4200. **                                   12923ms building modules                                                               6ms add04101ms2195ms asse117ms emitting
Hash: af987254a406091fbfc8
Version: webpack 2.1.0-beta.25
Time: 20388ms
           Asset     Size  Chunks             Chunk Names
  main.bundle.js  4.71 MB    0, 2  [emitted]  main
styles.bundle.js  28.5 kB    1, 2  [emitted]  styles
       inline.js  5.53 kB       2  [emitted]  inline
        main.map  5.05 MB    0, 2  [emitted]  main
      styles.map  36.8 kB    1, 2  [emitted]  styles
      inline.map  5.59 kB       2  [emitted]  inline
      index.html  1.42 kB          [emitted]  

ERROR in [default] /home/wunder/projects/angular2-firebase-material-demo/node_modules/rxjs/observable/PairsObservable.d.ts:1:0 
Cannot find type definition file for 'chai'.

ERROR in [default] /home/wunder/projects/angular2-firebase-material-demo/node_modules/rxjs/observable/dom/AjaxObservable.d.ts:1:0 
Cannot find type definition file for 'chai'.
Child html-webpack-plugin for "index.html":
         Asset    Size  Chunks       Chunk Names
    index.html  3.8 kB       0       
webpack: bundle is now VALID.`

Most helpful comment

@tarlepp It seems rxjs requires @types/chai somehow.
I also ran into the same error message and I could solve with this in my case. Hope this helps you as a workaround to suppress the error messages.

npm i --save-dev @types/chai

I think chai is a test framework, so hope rxjs should not include the dependency in the released module.

All 19 comments

Did you change the rxjs version? It should be beta12.

Actually I did update that to newest one, because ncu told me there was newer version available...

So how should users know which packages to update and which not? Although it seems to work just fine if I just remove "rxjs": "5.0.0-rc.2" from my package.json and rm -rf node_modules + npm install

@tarlepp It seems rxjs requires @types/chai somehow.
I also ran into the same error message and I could solve with this in my case. Hope this helps you as a workaround to suppress the error messages.

npm i --save-dev @types/chai

I think chai is a test framework, so hope rxjs should not include the dependency in the released module.

It is ReactiveX/rxjs#2112 (Which in turn apparently is a TypeScript compiler issue), so it is on the radar.

Manually adding chai types as dev dependency as @tmtk75 says is an easy workaround for now.

Angular has a fixed peerDep version of 5.0.0-beta.12. I wouldn't update until angular does as well.

We believe we have fixed this in RxJS 5.0.0-rc3, which was just published. https://github.com/ReactiveX/rxjs/pull/2120

Edit: we accidentally didn't include the fix in that release..so it's not fixed. Sorry folks! 馃槥

still getting error with RxJS 5.0.0-rc3

馃槩

just upgraded to rc3, still there.

same issue here with rc3

The above comment npm i --save-dev @types/chai should fix it. Is there an open issue for Rxjs somewhere about this?

@MarkPieszak
Read 5 comments above yours

Missed that, thank you! Perfect. @jmesa-sistel

The solution of @tmtk75 worked for me on RxJS RC5

Yeah installing @types/chai fixes this, and the problem is still with latest RxJS

this should be easily fixed

but adding the dependency worked

This got fixed with lastes rxjs, closing the ref issue ReactiveX/rxjs#2112.

Yeah I can confirm that latest rxjs 5.0.0-rc.4 solves this, no need for npm i --save-dev @types/chai anymore. Closing this one for now.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings