krish mandava
krish mandava

Reputation: 13

Error: Cannot combine @Input decorators with query decorators

I have upgraded my app from Angular 7 to 10. Below are my dependencies.

    "@angular/animations": "~10.1.2",
    "@angular/cdk": "10.2.1",
    "@angular/common": "~10.1.2",
    "@angular/compiler": "~10.1.2",
    "@angular/core": "~10.1.2",
    "@angular/forms": "~10.1.2",
    "@angular/material": "10.2.1",
    "@angular/material-moment-adapter": "10.2.1",
    "@angular/platform-browser": "~10.1.2",
    "@angular/platform-browser-dynamic": "~10.1.2",
    "@angular/router": "~10.1.2",
    "@stomp/ng2-stompjs": "^7.2.0",
    "@swimlane/ngx-datatable": "^14.0.0",
    "@types/gapi": "0.0.39",
    "@types/moment-range": "^4.0.0",
    "@types/uuid": "^3.4.4",
    "acorn": "^6.1.0",
    "angular-in-memory-web-api": "0.5.4",
    "aws-sdk": "^2.556.0",
    "aws-smtp-credentials": "^1.0.0",
    "body-parser": "^1.19.0",
    "browserslist": "^4.12.0",
    "caniuse-lite": "^1.0.30001048",
    "compression": "^1.7.4",
    "core-js": "^2.5.4",
    "dotenv": "^8.2.0",
    "express": "^4.16.4",
    "google-auth-library": "^5.5.1",
    "googleapis": "^59.0.0",
    "jquery": "^3.4.1",
    "jspdf": "^1.5.3",
    "mathjs": "^5.10.3",
    "moment": "^2.24.0",
    "moment-range": "^4.0.2",
    "moment-timezone": "^0.5.28",
    "ng-gapi": "0.0.93",
    "ng-pick-datetime": "^7.0.0",
    "ng-svg-icon-sprite": "^1.6.0",
    "ngx-markdown": "^7.1.5",
    "nodemailer": "^6.4.11",
    "nodemailer-ses-transport": "^1.5.1",
    "path": "^0.12.7",
    "rxjs": "~6.6.3",
    "rxjs-compat": "^6.6.3",
    "server-destroy": "^1.0.1",
    "sockjs-client": "^1.4.0",
    "tslib": "^1.9.0",
    "validator": "^13.1.1",
    "web-animations-js": "2.3.1",
    "xoauth2": "^1.2.0",
    "zone.js": "~0.10.3",
    "zxcvbn": "^4.4.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.1001.2",
    "@angular/cli": "~10.1.2",
    "@angular/compiler-cli": "~10.1.2",
    "@angular/language-service": "~10.1.2",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^8.9.5",
    "breakpoint-sass": "^2.7.1",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "svg2sprite-cli": "^2.0.1",
    "ts-node": "~7.0.0",
    "tslint": "~5.11.0",
    "typescript": "~4.0.3"
  }

When I ran the applications I get the below error Error: Cannot combine @Input decorators with query decorators

I have never used @Input with query decorators in my code

Also, I get the below warnings WARNING in /add-user.component.ts depends on 'jquery'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in sing.component.ts depends on 'rxjs/add/observable/of'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

WARNING in proposal.component.ts depends on 'jspdf'. CommonJS or AMD dependencies can cause optimization bailouts. For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

Upvotes: 1

Views: 1139

Answers (2)

Celokuhle Myeza
Celokuhle Myeza

Reputation: 11

Make sure all @ViewChild's come first and @Input's at the and. Also add { static: true } option on @ViewChild

Upvotes: 1

krish mandava
krish mandava

Reputation: 13

Finally found that I have to uninstall @swimlane/ngx-datatable as it was not compatible with Angular 10

Upvotes: 0

Related Questions