Angular-cli: ng build fails with TypeError: core_1.Version is not a constructor

Created on 8 Dec 2016  路  6Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Yes

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

1.0.0-beta.20-4

Note our application has crucial dependencies on third-party libraries that worked fine then started failing when 1.0.0-beta.22 was released. So our production application using those production libraries on the official release of Angular is dead. Our work-around was to use an outdated (but working) angular-cli. The results was different but worse insofar as it's failing on angular-cli libraries themselves now. Found salvation using 1.0.0-beta.21 which actually worked.

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

ng build

The log given by the failure.

Normally this include a stack trace and some more information.

TypeError: core_1.Version is not a constructor

Mention any other details that might be useful.

As mentioned, things still work if you use 1.0.0-beta.21

Here's the file that errors with 1.0.0-beta-20-4:

TypeError: core_1.Version is not a constructor
at Object. (...\node_modules\@angular\compiler-cli\src\version.js:18:19)
at Module._compile (module.js:556:32)


Thanks! We'll be in touch soon.

All 6 comments

Even I am facing same issue..

Had same issue. Forgot to "freeze" version of "@angular/compiler-cli" which got upgraded and was ahead of other angular lib versions. I set it to "2.2.4" (as my other libs) and it works again.

I am facing same issue too.

I upgrade @angular-cli version to 1.0.0-beta.21 and the error resolved

Closing this as resolved.

I am facing same issue too.

Was this page helpful?
0 / 5 - 0 ratings