Solvedangular Angular compiler v5.2.1 getOutputName is not a function

I'm submitting a...

[ ] Regression (a behavior that used to work and stopped working in a new release)
@angular/compiler@5.1.3 is ok, but @angular/compiler@5.2.1 is not work, 
error:

`
ERROR in TypeError: _this.host.getOutputName is not a function
    at getOriginalName (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:29582:32)
    at ReferenceTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:29627:43)
    at visitValue (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:426:24)
    at /var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:65
    at Array.forEach ()
    at ReferenceTransformer.ValueTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:26)
    at ReferenceTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:29654:60)
    at visitValue (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:426:24)
    at /var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:65
    at Array.forEach ()
    at ReferenceTransformer.ValueTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:26)
    at ReferenceTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:29654:60)
    at visitValue (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:426:24)
    at /var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:65
    at Array.forEach ()
    at ReferenceTransformer.ValueTransformer.visitStringMap (/var/lib/postgresql/carepilot-web/node_modules/@angular/compiler/bundles/compiler.umd.js:483:26)

`

[ ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment

node8.5.0 npm 5.3.0
win 10 pro x64 and Ubuntu 14.04.5 both not work

├── @agm/core@1.0.0-beta.2
├── @angular/cli@1.6.4
├── UNMET PEER DEPENDENCY @angular/common@5.2.1
├── UNMET PEER DEPENDENCY @angular/compiler@5.2.1
├── @angular/compiler-cli@5.0.1
├── UNMET PEER DEPENDENCY @angular/core@5.2.1
├── @angular/forms@5.2.1
├── UNMET PEER DEPENDENCY @angular/http@5.2.1
├── @angular/platform-browser@5.2.1
├── @angular/platform-browser-dynamic@5.2.1
├── @angular/router@5.2.1
├── @angular/upgrade@5.2.1
├── @ng-bootstrap/ng-bootstrap@1.0.0-beta.9
├── @ngx-loading-bar/http-client@1.1.0
├── @ngx-translate/core@8.0.0
├── @ngx-translate/http-loader@2.0.1
├── @types/angular-ui-router@1.1.40
├── @types/google-maps@3.2.0
├── @types/hammerjs@2.0.35
├── @types/jasmine@2.8.4 invalid
├── @types/lodash@4.14.92
├── @types/node@8.5.9
├── @uirouter/angular-hybrid@3.1.8
├── UNMET PEER DEPENDENCY angular@^1.5.0
├── angular-svg-round-progressbar@1.2.1
├── angular2-jwt@0.2.3
├── angular2-moment@1.7.1
├── animate.css@3.5.2
├── auth0-js@7.6.1
├── bootstrap@3.3.7
├── classlist.js@1.1.20150312
├── codelyzer@2.0.1
├── core-js@2.5.3
├── cross-env@5.1.3
├── del@2.2.2
├── eslint-config-angular@0.5.0
├── eslint-plugin-angular@1.6.4
├── event-stream@3.3.4
├── express@4.16.2
├── express-sslify@1.2.0
├── font-awesome@4.7.0
├── graceful-fs@4.1.11
├── hammerjs@2.0.8
├── jasmine-core@2.5.2
├── jasmine-reporters@2.3.0
├── jasmine-spec-reporter@3.2.0
├── jquery@3.2.1
├── jshint@2.9.5
├── karma@1.4.1
├── karma-chrome-launcher@2.0.0
├── karma-cli@1.0.1
├── karma-coverage-istanbul-reporter@0.2.0
├── karma-jasmine@1.1.1
├── karma-jasmine-html-reporter@0.2.2
├── karma-junit-reporter@0.4.2
├── karma-phantomjs-launcher@1.0.4
├── livereload@0.6.3
├── lodash@4.17.4
├── moment@2.20.1
├── ng-click-outside@3.2.0
├── ng-sidebar@6.0.5
├── ng-socket-io@0.2.4
├── ng2-file-upload@1.3.0
├── ng2-img-cropper@0.9.0
├── ng2-validation@4.2.0
├── ngu-utility@1.0.3
├── ngx-dynamic-template@2.3.1
├── ngx-pipes@2.1.0
├── parallelshell@3.0.2
├── phantomjs-prebuilt@2.1.16
├── pre-commit@1.2.2
├── protractor@5.0.0
├── protractor-console-plugin@0.1.1
├── reflect-metadata@0.1.12
├── rxjs@5.5.6
├── serve-favicon@2.4.5
├── ts-loader@3.2.0
├── ts-node@2.0.0
├── UNMET PEER DEPENDENCY tslint@5.8.0
├── UNMET PEER DEPENDENCY typescript@2.6.2
├── web-animations-js@2.3.1
├── webpack@3.10.0
├── webpack-stream@4.0.0
└── zone.js@0.8.20

Angular version: X.Y.Z


Browser:
- [ ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: XX  
- Platform:  

Others:

So I want to know, is it a bug?

20 Answers

✔️Accepted Answer

@LucasFrecia , thank you for the repro sample.

The reason is @angular/complier-cli in devDependencies should also be updated to 5.2.x (the same version with @angular/compiler.

Other Answers:

Same problem

Broke my live demo I was running in front of about 50 people at an event, I looked pretty stupid. >:-(

I've "fixed" this by locking my versions in my package.json to 5.1.1 rather than risking semver pulling in latest version

Same issue. I believe private host: StaticSymbolResolverHost is not being supplied with a type that implements getOutputName. This appears in static_symbol_resolver.ts, line 391

Downgrading to before the introduction of getOutputName solved my issue.

More Issues: