New in rc.2:
C:\projects\dayapp\node_modules\rxjs\observable\PairsObservable.d.ts
Error:(1, 1) TS2688: Cannot find type definition file for 'chai'.
C:\projects\dayapp\node_modules\rxjs\observabledom\AjaxObservable.d.ts
Error:(1, 1) TS2688: Cannot find type definition file for 'chai'.
workaround
npm install --save-dev @types/chai
Some of transpiled results has unexpected type references,
/// <reference types="chai" />
import { Observable } from '../../Observable';
import { Subscriber } from '../../Subscriber';
import { TeardownLogic } from '../../Subscripti...'
while those file does not uses those type references. Seems it's known issue of TS, updated compiler to latest dev to avoid this.
Update to TS 2.1 Dev didn't help. Used 'next' version of TS in package.json.
Gone back to rxjs 5 rc1 and using TS latest (2.0.8) is working so far.
Waiting for fix.
I don't have a solution to this yet, but I think the problem is caused by Typescript's automatic @types detection of node_modules/@types/chai leaking into prod code, caused after switching away from Typings.
After running npm run build_es6 (with master at 922d04e), I can see four .d.ts files have the problematic line:
/// <reference types="chai" />

src/util/assign.ts is a particularly small source file that ends up with the problematic chai dependency. The problem goes away if we remove any mention of Object from the file - specifically, I changed the signature of assignImpl from:
export function assignImpl(target: Object, ...sources: Object[]) {
to
export function assignImpl(target: any, ...sources: any[]) {
(The three other files also have mentions of Object).
It seems that the @types/chai package that is installed as part of 5.0.0-rc2 mentions Object at line 414:
interface Object {
should: Chai.Assertion;
}
Between 5.0.0-rc.1 and 5.0.0-rc.2, the dist output may have been affected by:
npm install to yarnNote, the version of chai never changed from ^3.5.0 and the content of the chai typings file isn't the problem. If I copy typings/globals/chai/index.d.ts from 5.0.0-rc.1 and paste it into node_modules/@types/chai/index.d.ts, I still get four unwanted chai references in the built dist.
I can't see any evidence that yarn is the problem here, it seems much more likely that switching from Typings to the new @types modules caused the problem. Despite having two tsconfig.json files (one for main, one for spec), it seems like the typescript compiler is happily pulling node_modules/@types/chai into main code (when it should only be pulled into spec code).
Ideally, if we could switch off tsc's node_modules/@types resolution for the main dist, I think this would solve everything. (Not sure if typescript supports this, or is even aware this can be a problem). Alternatively, rxjs could just switch back to using Typings instead of the new npm modules.
I'm sure there are lots of other possible solutions, I defer to the rxjs team to pick a sensible one!
JFYI:
I'm actually using some @types (e.g. highcharts , jquery) and this is working with my above mentioned combination (rc1 + TS 2.0.8)
@iamdanfox yes, I suspect it's related to https://github.com/Microsoft/TypeScript/issues/11948
@Skuriles it'll not be resolved by consumer side TSC version, since type definition is already published includes those references.
I'm seeing couple of options here
typings@types/ as dependency instead of devDependency while waiting compiler issue resolvedWhy not just publish a new version to npm that fixes the issue while waiting for the fix in TS?
@karlbohlmark I think we will.
@kwonoj Great, thanks!
5.0.0-rc3 was just published, which solved this. If not, please reopen!
@jayphelps
I confirm this problem is not resolved in 5.0.0-rc3.
We need to republish it.
/// <reference types="chai" />@types/chai.@kwonoj any guesses?
@jayphelps is it possible to confirm node_modules have remaining @types packages when pack new package? if it does, force clear node_modules then retry npm pack.
I can confirm this error in RC3. Still
PairsObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
AjaxObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
error on compile.
I can also confirm that this error still exists in RC3 after clearing node_modules
[08:26:37] [tsc] > node_modules/rxjs/observable/PairsObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
[08:26:37] [tsc] > node_modules/rxjs/observable/dom/AjaxObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
I'm still not seeing these /// <reference types="chai" /> references when I build locally...Can someone else fetch the latest, build, and confirm they do or do not see /// <reference types="chai" /> in observable/PairsObservable.d.ts or observable/dom/AjaxObservable.d.ts?
That is, I DO see them in the npm package tarball, but not when I build locally.
@jayphelps as commented above, I am currently suspect when packing current one there was remaining types module in local node_modules, which makes package have old behavior and explains why local build works. To confirm this, may need check machine being used for package and check those modules are remaining, then republish new package as needed if it's confirmed in those way. (Just fyi, local build also works for me after force clear node_modules and reinstall)
@kwonoj sorry, I misunderstood what you meant in your original comment. I suspect the same thing. I've pinged @blesh.
I can confirm this is happening with rc.3 in a fresh install.

Confirmed. Still happening using latest TypeScript version. Previously reported on this issue https://github.com/Microsoft/TypeScript/issues/11948
@here it is known and reproducible issue with latest package and currently expected to resolve in next package publish.
I believe this issue is fixed with latest rc.4 package publish.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I can confirm this error in RC3. Still
PairsObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
AjaxObservable.d.ts(1,1): error TS2688: Cannot find type definition file for 'chai'.
error on compile.