-
Notifications
You must be signed in to change notification settings - Fork 12k
Module build failed: TypeError: Cannot read property 'directoryExists' of undefined #1997
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
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 but not on my computer. I did the migration from RC4 to RC5 between monday and Wednesday (last week) and I did not have the issue. |
I just started a new project based on the current master and received the same error upon |
Issue is with |
The most recent update to awesome-typescript-loader is breaking new builds, hard coding the version to 2.2.1 resolves the issue for now Fixes issue angular#1997
that didn't work for me |
+1 My package.json doesn't even include awesome-typescript-loader. Project created with, and still using angular-cli: 1.0.0-beta.11-webpack.8. Works on one PC: win 10, node 6.2.1, npm 3.10.7 ERROR in ./src/main.ts |
@JSMike how I generate the bin file of the angular-cli with the change you made in package.json? |
@aderbas See this article on cloning angular-cli, using |
@fredrik-lundin You can just add "awesome-typescript-loader": "2.2.1" to your package.json. |
"awesome-typescript-loader": "2.2.1" fixed it!! |
Yeah, fix here:
Thanks guys |
Thanks! Worked as a temporary (:wink:) fix on an existing project locally and propagated well to the related Travis test config. |
Dynamic transitive dependencies in action... :( why not avoid |
As other has said, can we please not use ^? I just spotted a ^ on the way in (for TS ^2.0.2) and asked about it there. It seems like now is a good stop to proactively stop the breakage which has hit CLI several times over the last several months. |
Hmm. I have this exact issue, also using awesome-typescript-loader. Was already using v2.2.1 when the issue showed up - I see the issue only on Linux, but the same build works fine on Mac OS X Unix. So, presumably using v2.2.1 would not be a fix, since the error occurs with that version. |
Yeah just ran into this as well. Adding |
Just adding 2.2.1 to dev didn't resolve the issue for me, however, then after removing Then I start over with a new project and try to find why 2.2.3 version was included using |
@waterscar That's the magic of dynamic transitive dependencies. angular-cli declares the dependency as At the time the developers declared this dependency, version 2.2.1 was the current version and it worked. But what if the awesome-typescript-loader project publishes new versions 2.2.2 and 2.2.3? Anyone who Whatever it is, dynamic transitive dependencies are bad and we should stop using them. Edit: oh and the reason it works when manually specified is that by not putting a |
The "awesome" fix resolved the issue of trying to access directoryExists on undefined but now there are a half dozen "Type 'Type' is not generic" errors in config.d.ts, router.d.ts and router_state.d.ts: ERROR in [default] ...\node_modules@angular\router\src\router.d.ts:216:35 As you can tell it's a Windows machine in this case but otherwise the same RC5 with Typescript 2.0.0 etc. It's choking on nested generics:
|
@toadskin Did you try pinning |
fix taken from: angular/angular-cli#1997
+1 |
Adding awesome-typescript-loader pinned to 2.2.1 is a partial solution. I found you must a) clear your npm cache, b) delete node_modules folder from your project, c) remove ^ so you get the precise version you are asking for (2.2.2 versus 2.X.X). Even then you will get a slew of ERR! messages during npm install (clearly that must be remedied) but the subsequent ng build will succeed. BTW, the router error referenced above (Type "Type" is not generic) goes away when removing the caret from the @angular/router version. I wonder if semantic versioning has to be written off as a good idea that fails in practice, because there is no means of ensuring successive 1.X.X versions are compatible with previous 1.X.X versions. |
I've set awesome-typescript-loader to 2.2.1 without the ^ before doing an npm install on a fresh install of npm since in using docker container and this error is still present has anyone managed to get it working? |
i found issue angular/angular-cli#1997
Just type this in your project : |
@pdelorme, this package should be a dev dependency, it's not needed for production. The line should be:
|
* added generated angular2 project * added AdminLTE2 theme * applied infiniboard index.html * fixed layout * added routing added pageNotFound * added mocked dashboards route * fixed 404 layout * added not yet implemented page * package dashy instead of infiniboard-app * exposed mongo port locally * changed CORS port to ng development port * added dashboard service extracted dev/prod urls to environment * building dashy instead of infiniboard-app * added dashboard components for list / details added widget service * moved widget service into dashboard * added dynamic widget creation * added platform status widget * added widget type to quartermaster * added status pipes * moved to hash location strategy * added nvm and license * moved index site * removed function order * seperated frontend build steps * removed linting as long as app- prefix is required * removed old client * added installation of angluar-cli to build * fixed workin dir * exporting the default port crashes the circleci build as a local mongod is already running * pinned dependencies * added definition of transitive dependency fix taken from: angular/angular-cli#1997 * fixed cache dir * added linting to build removed forces prefix * cleaned up removed duplicated links.component removed unimplemented OnInit / constructor removed unused AdminLTE layout fix * activated running of specs * activated singleRun, so tests can be run on circleci * disabled test to finish, so it can be fixed one by one * added junit reporter to karma * updated angular to 2.0.0 * cleaned up tests added example for mocking services * fixed moved import * fixed linting errors * added mock data * added tests for pipes * added dashboard.ts tests * used toEqual instead of toBe * added dashboard service tests * added widget-config tests * added tests for widget service cleanup * prepared for widget service error teststing * changed error handling method to return server error
This has since been fixed, and should be present in beta.14+. |
Module build failed: TypeError: Cannot read property 'replace' of undefined version: Package Version@angular-devkit/architect 0.800.2 |
"dependencies": { |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Linux, Ubuntu 14.04
Versions. Please run
ng --version
. If there's nothing outputted, please runin a Terminal:
node --version
and paste the result here:do on your code? etc.
I had the error on a project and decided to create a new one for testing.
I have not changed anything.
more information.
The text was updated successfully, but these errors were encountered: