-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
getDefaultLibFilePath finds lib.d.ts in wrong node_module (TS 1.6.2) #4929
Comments
Made some progress here. I found that And I think I understand that as of TS 1.6.2 the FYI this is gulp-tslint@3.3.0-beta (latest) |
as a workaround, I lazy-require tslint in one gulp task where we need it, rather than at the top of our gulpfile. |
interesting. As I can see tslint adds
// file: run.js
// dependencies: typescript, tslint
var a = require('typescript');
var b = require('tslint');
console.log(ts.getDefaultLibFilePath({})); what is interesting is that in your example you have |
My report wasn't quite complete - when I encountered this issue, it was with another local change while I debugged issues with the new node-compatible module loading. I actually had no require or import of typescript at all (in order to satisfy the type-checker). That failed at runtime but only after I got past this issue. |
Just to elaborate, TypeScript does not expose global value named
then |
I see, then I think this is not an issue for anyone, unless they are already doing something wrong, it is just surprising to get TypeScript implementation exposed in a 'ts' variable from tslint. Please re-open if I'm getting that wrong. |
I'm working to upgrade Angular to TS 1.6.2.
We wrap the TS language services with a broccoli wrapper for incremental builds. Here is where we lookup the location of the standard lib.d.ts:
https://github.com/angular/angular/blob/master/tools/broccoli/broccoli-typescript.ts#L191
When I run this after upgrading to TS 1.6.2, and with a log statement, I see
defaultLibFilePath /Users/alexeagle/Projects/angular/node_modules/gulp-tslint/node_modules/tslint/lib/lib.d.ts
which is strange since there is no such file anyway
It seems this implementation must be searching under node_modules for a lib/ folder? I don't know how else to explain this behavior.
The text was updated successfully, but these errors were encountered: