Teradata / covalent

Teradata UI Platform built on Angular Material
https://teradata.github.io/covalent/
MIT License
2.23k stars 358 forks source link

ng build --prod ERROR #1131

Closed tw949561391 closed 6 years ago

tw949561391 commented 6 years ago

package.json { "name": "sl-admin", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build --prod", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^5.2.0", "@angular/cdk": "^5.2.0", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", "@angular/material": "^5.2.0", "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/platform-server": "^5.2.0", "@angular/router": "^5.2.0", "@covalent/core": "^1.0.0", "@covalent/http": "^1.0.0", "core-js": "^2.4.1", "hammerjs": "^2.0.8", "ngx-img-cropper": "^0.9.7", "ngx-webstorage": "^2.0.1", "rxjs": "^5.5.6", "web-animations-js": "2.3.1", "zone.js": "^0.8.19" }, "devDependencies": { "@angular/cli": "~1.7.3", "@angular/compiler-cli": "^5.2.0", "@angular/language-service": "^5.2.0", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~2.0.0", "karma-chrome-launcher": "~2.2.0", "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": "~4.1.0", "tslint": "~5.9.1", "typescript": "~2.5.3" } }

Bug Report

StackBlitz template: https://stackblitz.com/edit/covalent Plunker template: http://plnkr.co/edit/XhSrUWBw2RhCkXPoE4fn

Screenshots or link to CodePen/Plunker/JSfiddle

What is the expected behavior?

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

Which version of Angular and Material, and which browser and OS does this issue affect?

Did this work in previous versions of Angular / Material?

Other information
tw949561391 commented 6 years ago

ERROR in ../@covalent/core/covalent-core.ts(118,17): Error during template compile of 'TdNavigationDrawerComponent' Function calls are not supported in decorators but 'TdCollapseAnimation' was called.

tw949561391 commented 6 years ago

"$angular/animations": "^5.2.0", "$angular/cdk": "^5.2.0", "$angular/common": "^5.2.0", "$angular/compiler": "^5.2.0", "$angular/core": "^5.2.0", "$angular/forms": "^5.2.0", "$angular/http": "^5.2.0", "$angular/material": "^5.2.0", "$angular/platform-browser": "^5.2.0", "$angular/platform-browser-dynamic": "^5.2.0", "$angular/platform-server": "^5.2.0", "$angular/router": "^5.2.0", "$covalent/core": "^1.0.0", "$covalent/http": "^1.0.0", "core-js": "^2.4.1", "hammerjs": "^2.0.8", "ngx-img-cropper": "^0.9.7", "ngx-webstorage": "^2.0.1", "rxjs": "^5.5.6", "web-animations-js": "2.3.1", "zone.js": "^0.8.19"

MehdiSaeedifar commented 6 years ago

I have the same error. It seems related to angular/angular#14707

emoralesb05 commented 6 years ago

hmm, i wonder why this doesnt happen in our applications.. going to try a few things to see if i can replicate it.

pf-guilhermechiara commented 6 years ago

Having the same error. Tried a little things to make it work, but got nothing.

pf-guilhermechiara commented 6 years ago

Found out the problem. Updated typescript to version 2.6.2 and everything started working! :)

emoralesb05 commented 6 years ago

Awesome, thanks for the info!.. Gonna keep this PR open so other people can see the fix and add a faqs label

sunnyfly1990 commented 6 years ago

I changed the version to 2.6.2, but still not work while using "ng build --prod", even "ng build" always works fine. "dependencies": { "@angular/animations": "^5.2.0", "@angular/cdk": "^5.2.4", "@angular/common": "^5.2.0", "@angular/compiler": "^5.2.0", "@angular/core": "^5.2.0", "@angular/forms": "^5.2.0", "@angular/http": "^5.2.0", "@angular/material": "^5.2.4", "@angular/platform-browser": "^5.2.0", "@angular/platform-browser-dynamic": "^5.2.0", "@angular/router": "^5.2.0", "@covalent/dynamic-forms": "^1.0.0", "@covalent/highlight": "^1.0.0", "@covalent/http": "^1.0.0", "@covalent/markdown": "^1.0.0", "core-js": "^2.4.1", "jquery-autotab": "^1.9.2", "rxjs": "^5.5.6", "web-animations-js": "^2.3.1", "zone.js": "^0.8.19" }, "devDependencies": { "@angular/cli": "~1.7.3", "@angular/compiler-cli": "^5.2.0", "@angular/language-service": "^5.2.0", "@types/jasmine": "~2.8.3", "@types/jasminewd2": "~2.0.2", "@types/node": "~6.0.60", "codelyzer": "^4.0.1", "jasmine-core": "~2.8.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~2.0.0", "karma-chrome-launcher": "~2.2.0", "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": "~4.1.0", "tslint": "~5.9.1", "typescript": "~2.6.2" }

tsc -v Version 2.6.2

Error: ERROR in : Unexpected value 'CovalentLayoutModule in C:/.../src/app/app.module.ts'. Please add a @NgModule annotation.

emoralesb05 commented 6 years ago

@sunnyfly1990 im assuming its a cache issue.. i would recommend blowing away your node_modules dir and reinstalling.

sunnyfly1990 commented 6 years ago

@emoralesb05 Thanks a lot! Cleared the node_modules dir and reinstalled, all works fine now :) .

jbojcic1 commented 6 years ago

I am getting this issue:

"ERROR in ..//covalent-core.ts(118,17): Error during template compile of 'TdNavigationDrawerComponent' Function calls are not supported in decorators but 'TdCollapseAnimation' was called."

when trying to analyze my project with ngrev (https://github.com/mgechev/ngrev). I have covalent 1.0.1, ts 2.6.2 and my prod build works fine.

emoralesb05 commented 6 years ago

We are probably gonna change the way we add animations into our components.. we cant replicate this issue, but its always an animation.