angular: 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 (<anonymous>)
    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 (<anonymous>)
    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 (<anonymous>)
    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?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 30
  • Comments: 19 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Same problem

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

@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.

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.

I tried to delete node_modules and install again but still doesn’t work. I have this error - ERROR in _this.host.getOutputName is not a function

My package.json:

"dependencies": {
    "@angular/animations": "^5.2.2",
    "@angular/cdk": "^2.0.0-beta.8",
    "@angular/common": "^5.2.2",
    "@angular/compiler": "^5.2.2",
    "@angular/compiler-cli": "^4.3.5",
    "@angular/core": "^5.2.2",
    "@angular/forms": "^5.2.2",
    "@angular/http": "^5.2.2",
    "@angular/material": "^2.0.0-beta.8",
    "@angular/platform-browser": "^5.2.2",
    "@angular/platform-browser-dynamic": "^5.2.2",
    "@angular/platform-server": "^5.2.2",
    "@angular/router": "^5.2.2",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.4",
    "rxjs": "^5.5.6",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.2.0",
    "@angular/compiler-cli": "^5.2.2",
    "@angular/language-service": "^4.0.0",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "^2.4.2"
  }

I tried to downgrade to 5.1.1. Still doesn’t work.

How to fix this error?

Same error in happening to me.

i’m using.

“devDependencies”: { “@angular/cli”: “^1.6.2”, “@angular/compiler-cli”: “^5.1.3”, “@angular/core”: “^5.1.3”,

i uninstall the angular/cli -g and remove the node_module folder.

Note, I had to do the following to fix it:

  • Remove node_modules , resulting in same error after npm install
  • Clear npm cache with npm cache clean --force, resulting in same error after first step and npm install
  • Remove __package-lock.json __ and remove node_modules… SUCCESS

Please only remove package-lock.json if you are completely sure there is not any other way to fix it.

Update angular to 5.2.3 using npm update. It has worked for me.

I’ve done a clean checkup on my repository after updating from Angular 4 to 5 and this seems to fix my issue.