Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Issue with 2.2.2 and 2.2.3 #226

Closed
jmc265 opened this issue Sep 6, 2016 · 4 comments
Closed

Issue with 2.2.2 and 2.2.3 #226

jmc265 opened this issue Sep 6, 2016 · 4 comments

Comments

@jmc265
Copy link

jmc265 commented Sep 6, 2016

This issue is not present when using 2.2.1.

The build results in a failure with message:

ERROR in ./src/main.ts                                                                                                                                                                              
Module build failed: TypeError: Cannot read property 'directoryExists' of undefined                                                                                                                 
    at Object.getAutomaticTypeDirectiveNames (/Users/james/Documents/Workspace/.../node_modules/typescript/lib/typescript.js:43865:17)                                     
    at State.loadTypesFromConfig (/Users/james/Documents/Workspace/.../node_modules/awesome-typescript-loader/src/host.ts:150:36)                                          
    at new State (/Users/james/Documents/Workspace/.../node_modules/awesome-typescript-loader/src/host.ts:144:14)                                                          
    at Object.ensureInstance (/Users/james/Documents/Workspace/.../node_modules/awesome-typescript-loader/src/instance.ts:150:19)                                          
    at compiler (/Users/james/Documents/Workspace/.../node_modules/awesome-typescript-loader/src/index.ts:37:20)                                                           
    at Object.loader (/Users/james/Documents/Workspace/.../node_modules/awesome-typescript-loader/src/index.ts:18:18)

Can provide more information if needed.

@textbook
Copy link

textbook commented Sep 6, 2016

This happens because host.ts:150 passes two arguments to getAutomaticTypeDirectiveNames:

const directives = this.ts.getAutomaticTypeDirectiveNames(options, this.compilerHost);

which expects three (typescript.d.ts:1880):

function getAutomaticTypeDirectiveNames(options: CompilerOptions, rootFiles: string[], host: CompilerHost): string[];

(using [email protected])

@s-panferov
Copy link
Owner

s-panferov commented Sep 6, 2016

[email protected] is obsolete, please use typescript@rc (2.0.2 right now) which introduces some fixes and behavior changes.

@textbook
Copy link

textbook commented Sep 6, 2016

typescript@beta is still 2.0.0, and that's what Angular CLI requires (see e.g. angular/angular-cli#1917). Guess this is what happens when you try to hit a moving target...

@s-panferov
Copy link
Owner

@textbook rc > beta according to http://semver.org/, so I believe angular-cli should move to the latest stable version, which is rc 2.0.2

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants