-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot find type definition file for 'chai' #2112
Comments
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. |
I don't have a solution to this yet, but I think the problem is caused by Typescript's automatic @types detection of 1. Local reproAfter running
2. Minimal example case
to
(The three other files also have mentions of It seems that the
3. Narrow down the causeBetween 5.0.0-rc.1 and 5.0.0-rc.2, the dist output may have been affected by:
Note, the version of chai never changed from 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 4. SolutionsIdeally, if we could switch off tsc's I'm sure there are lots of other possible solutions, I defer to the rxjs team to pick a sensible one! |
JFYI: |
@iamdanfox yes, I suspect it's related to microsoft/TypeScript#11948 I'm seeing couple of options here
|
Why 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! |
I confirm this problem is not resolved in 5.0.0-rc3. Environment
Problems
|
@kwonoj any guesses? |
@jayphelps is it possible to confirm |
I can confirm this error in RC3. Still PairsObservable.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
|
I'm still not seeing these 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) |
Confirmed. Still happening using latest TypeScript version. Previously reported on this issue microsoft/TypeScript#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. |
* Fix an issue with `chai` `@types`. ref: ReactiveX/rxjs#2112
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. |
Edit: fixed in rc4
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\observable\dom\AjaxObservable.d.ts
Error:(1, 1) TS2688: Cannot find type definition file for 'chai'.
workaround
The text was updated successfully, but these errors were encountered: