-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Compiler fails when using noResolve for global types #10678
Comments
the errors are thrown if the standard library is not included. how are you invoking the compiler? tsc? or through a build tool? if through a build what is it? if not can you share a sample project? |
Tsc |
does any of your files have a header of |
None, in fact removing the |
The errors are generated if the default library is not included. if you do |
$ tsc --listfiles outputs
|
Found the reason. It is the combination of using the
PS: @PWKad the
Hot fix workaround is to include all the lib files mentioned manually instead of using the |
ah.. that makes sense :) thank @basarat for the diagnosis. |
So the compiler needs to resolve these regarding of the |
Cool I'll give it a shot when I get home Thanks everyone for taking a look |
Fixed my issue perfectly thanks for pointing this out @basarat |
wasted 3 hours fighting this problem |
not sure how to fix this see microsoft/TypeScript#10678 $ tsc hackerrank.ts --lib ES2016 --lib DOM error TS2318: Cannot find global type 'Array'. error TS2318: Cannot find global type 'Boolean'. error TS2318: Cannot find global type 'Function'. error TS2318: Cannot find global type 'IArguments'. error TS2318: Cannot find global type 'Number'. error TS2318: Cannot find global type 'Object'. error TS2318: Cannot find global type 'RegExp'. error TS2318: Cannot find global type 'String'. Found 8 errors.
Seems like this is solved now. Not following reference paths is the intended behavior of noResolve |
TypeScript Version: 2.0.0
Code
I would like for my build process to output all of the javascript files in a separate folder it works fine. When I want to have a shared set of files that various directories can use I can add a
baseUrl
and apaths
property and it works great. The shared files get built to the same output folder and system.js path takes over to resolve on the client side. Because of the path the output wants to output the entire folder structure, so to prevent that I can use thenoResolve
option, which works great!The problem is I start getting errors for missing global types.
ex tsconfig.json
errors -
Expected behavior:
No errors should be thrown.
Actual behavior:
Errors are thrown, although the process still finishes.
The text was updated successfully, but these errors were encountered: