-
Notifications
You must be signed in to change notification settings - Fork 129
Support for typeRoots? #421
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
Comments
If anybody else needs the solution it is to switch to gulp-tsc as I could never get gulp-typescript to work at all using Angular 2.0 TS 2.0. There were a few other @types I needed to install such as @types/jasmine @types/node, however gulp-typescript will not use these type definitions regardless. gulp-tsc also has the ability to pass to tsc any parameter you want using options.additionalTscParameters, which is awesome. project/tsc <-- works great using tsconfig.json w/o typeRoots or types specified. Here's my new gulpfile.js for TS w/ gulp-tsc
My old gulp-typescript gulpfile..js which does not work
|
I'll take a look at this issue this weekend. |
I think that this has been solved in d706e30. Can you try whether gulp-typescript 3.0.2 solves your issues? Also, you can probably remove |
👍 @ivogabe. 3.0.2 fix worked. |
I discovered an issue with gulp-typescript version 3.0.2 and the typeRoots option: Observed Issue: My folder structure for my project:
My tsconfig.json
My gulp task for typescript compilation:
I can fix the problem for me if I change the typeRoots option in tsconfig.json to Expected Behavior |
@teetotum Does the behaviour of gulp-typescript differ from |
Oh diddums! Just tested my setup with a direct call to tsc.exe (2.0) and I get exactly the same error. Sorry for bringing the issue up here. gulp-typescript behaves correctly. |
Not sure if this ever got resolved. It appears to me that gulp-tsc uses some options form tsconfig.json but not others. Fore example, outDir was taken from tsconfig.json whereas sourceMap was ignored and I had to include in the options. typeRoots is ignored even if I include it in typescript options. Of course, tsc works fine from the terminal Any thoughts on how to get tsc working from gulp with typings in ./typings?
|
@mikaye This is the repository for gulp-typescript, but your post references gulp-tsc. gulp-typescript supports typeRoots, but I think that gulp-tsc should also support that options. If you need help with gulp-tsc you can better ask on some other place. |
this bug still exists. [email protected] gulp-typescript does not support |
@seminelee how to resolve this problem? |
When compiling with gulp-typescript I receive the error
error TS2304: Cannot find name 'Promise' (or Set or Map)
Having researched this issue I discovered the new TS compilerOption typeRoots.
http://stackoverflow.com/questions/35660498/angular-2-cant-find-promise-map-set-and-iterator
Properly setting this option in tsconfig.json and manually executing tsc, I no longer receive this error message. Unfortunately gulp-typescript does not support typeRoots.
Expected behavior:
Compile w/o error TS2304
Actual behavior:
/home/mike/Projects/rsvt/node_modules/@angular/core/src/facade/collection.d.ts(16,25): error TS2304: Cannot find name 'Map'.
[15:48:20] TypeScript error: /home/mike/Projects/rsvt/node_modules/@angular/core/src/facade/collection.d.ts(16,25): error TS2304: Cannot find name 'Map'.
/home/mike/Projects/rsvt/node_modules/@angular/core/src/facade/collection.d.ts(101,41): error TS2304: Cannot find name 'Set'.
[15:48:20] TypeScript error: /home/mike/Projects/rsvt/node_modules/@angular/core/src/facade/collection.d.ts(101,41): error TS2304: Cannot find name 'Set'.
Your gulpfile:
Include your gulpfile, or only the related task (with
ts.createProject
).tsconfig.json
Include your tsconfig, if related to this issue.
It would appear my problem is similar to
lib compilerOptions not used? #420
but resolved using a different TS 2.0 supported config option.
The text was updated successfully, but these errors were encountered: