nishantmc / angular-material-fileupload

A fileupload component based on angular-material design
MIT License
98 stars 78 forks source link

Can't build using --prod #40

Open arasan-augment opened 5 years ago

arasan-augment commented 5 years ago

I got the below error message while making build using --prod. It's working for me in dev mode.

ERROR in ../angular-material-fileupload/matFileUpload.module.ts(13,2): Error during template compile of 'MatFileUploadModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called in 'NgModule' 'NgModule' calls 'ɵmakeDecorator'. node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. node_modules/angular-material-fileupload/node_modules/@angular/core/src/linker/query_list.d.ts(36,22): error TS1039: Initializers are not allowed in ambient contexts. node_modules/angular-material-fileupload/node_modules/@angular/core/src/application_init.d.ts(26,21): error TS1039: Initializers are not allowed in ambient contexts. node_modules/angular-material-fileupload/node_modules/@angular/core/src/ivy_switch.d.ts(8,54): error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal. node_modules/angular-material-fileupload/node_modules/@angular/core/src/ivy_switch.d.ts(9,35): error TS1254: A 'const' initializer in an ambient context must be a string or numeric literal. node_modules/angular-material-fileupload/node_modules/@angular/core/src/render3/ng_dev_mode.d.ts(9,11): error TS2451: Cannot redeclare block-scoped variable 'ngDevMode'. node_modules/angular-material-fileupload/node_modules/@angular/common/http/src/response.d.ts(253,21): error TS1039: Initializers are not allowed in ambient contexts. node_modules/angular-material-fileupload/node_modules/@angular/common/http/src/response.d.ts(259,19): error TS1039: Initializers are not allowed in ambient contexts.

Kindly resolve this ASAP. Thanks in advance!

nishantmc commented 5 years ago

Hi @arasan-augment , Please share the deps in package.json.

arasan-augment commented 5 years ago

Hi @nishantmc This is my deps and devdeps in package.json

"dependencies": { "@agm/core": "1.0.0-beta.2", "@angular/animations": "~5.2.9", "@angular/cdk": "~5.2.4", "@angular/common": "~5.2.9", "@angular/compiler": "~5.2.9", "@angular/core": "~5.2.9", "@angular/flex-layout": "~5.0.0-beta.13", "@angular/forms": "~5.2.9", "@angular/http": "~5.2.9", "@angular/material": "~5.2.4", "@angular/material-moment-adapter": "^7.0.2", "@angular/platform-browser": "~5.2.9", "@angular/platform-browser-dynamic": "~5.2.9", "@angular/router": "~5.2.9", "@angular/service-worker": "~5.2.9", "@swimlane/ngx-datatable": "^11.2.0", "@swimlane/ngx-dnd": "^6.0.0", "@types/hammerjs": "^2.0.35", "@types/underscore": "^1.8.8", "angular-colorbox": "^1.1.5", "angular-google-place": "0.0.3", "angular-material-fileupload": "^2.0.0", "angular-star-rating": "^4.0.0-beta.3", "angular2-moment": "^1.9.0", "angularfire2": "^5.0.0-rc.6.0", "async": "^2.6.0", "class-transformer": "^0.1.9", "core-js": "^2.5.3", "css-star-rating": "^1.2.4", "d3": "^4.13.0", "es6-shim": "^0.35.3", "express": "^4.16.3", "firebase": "^5.5.8", "forever-monitor": "^1.7.1", "hammerjs": "^2.0.8", "keyboardevent-key-polyfill": "^1.1.0", "mdi": "^2.1.99", "moment": "^2.22.2", "ng2-charts": "^1.6.0", "ng2-expanding-table": "^1.5.2", "ng2-image-compress": "1.0.17", "ngx-breadcrumbs": "0.0.3", "ngx-chips": "^1.8.2", "ngx-infinite-scroll": "^6.0.1", "ngx-owl-carousel": "^2.0.7", "ngx-perfect-scrollbar": "^5.3.5", "ngx-quill": "^2.2.0", "node-sass": "^4.10.0", "normalize.css": "^8.0.0", "npm": "^6.4.1", "ol": "^4.6.5", "reflect-metadata": "^0.1.12", "rxjs": "^5.5.7", "screenfull": "^3.3.2", "script-loader": "^0.7.2", "time-ago-pipe": "^1.3.2", "underscore": "^1.8.3", "xlsx": "^0.14.1", "zone.js": "^0.8.20" }, "devDependencies": { "@angular-devkit/build-angular": "~0.10.0", "@angular/cli": "^7.0.6", "@angular/compiler-cli": "^5.2.10", "@angular/language-service": "^5.2.9", "@compodoc/compodoc": "^1.0.9", "@types/node": "^9.4.7", "@types/underscore": "^1.8.8", "angular-ide": "^0.9.39", "codelyzer": "^4.2.1", "hads": "^1.6.1", "protractor": "^5.3.0", "ts-node": "^5.0.1", "tslint": "^5.9.1", "typescript": "^2.6.2" }

tobias47n9e commented 5 years ago

Possible duplicate of #11

danjodesigns commented 4 years ago

Any fix on this? The above didn't do it for me! I'm using angular 8

danjodesigns commented 4 years ago

ERROR in Error during template compile of 'NgModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Can't export value MatFileUploadModule in C:/Dev/ppc.cms.client/node_modules/angular-material-fileupload/matFileUpload.module.d.ts from AppMaterialModule in C:/Dev/ppc.cms.client/src/app/app-material.module.ts as it was neither declared nor imported! Error during template compile of 'Component' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'NgModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'NgModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'NgModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'NgModule' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Injectable' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Component' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Pipe' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Error during template compile of 'Directive' Function calls are not supported in decorators but 'ɵmakeDecorator' was called. Can't bind to 'fileUploadInputFor' since it isn't a known property of 'div'. ("

<div *ngSwitchCase="'upload'"> <div [ERROR ->][fileUploadInputFor]="fileUploadQueue" class="content-form__file-drop"> Just drag and dro") Can't bind to 'fileAlias' since it isn't a known property of 'mat-file-upload-queue'.

  1. If 'mat-file-upload-queue' is an Angular component and it has 'fileAlias' input, then verify that it is part of this module.
  2. If 'mat-file-upload-queue' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("class="content-formfile-loader fileloader"> <mat-file-upload-queue #fileUploadQueue [ERROR ->][fileAlias]="'file'" [httpUrl]="url"> <div *ngIf="!hasUploadedSuccessfully && !isComple") Can't bind to 'httpUrl' since it isn't a known property of 'mat-file-upload-queue'.
  4. If 'mat-file-upload-queue' is an Angular component and it has 'httpUrl' input, then verify that it is part of this module.
  5. If 'mat-file-upload-queue' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  6. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("file-loader file__loader"> <mat-file-upload-queue #fileUploadQueue [fileAlias]="'file'" [ERROR ->][httpUrl]="url"> <div *ngIf="!hasUploadedSuccessfully && !isComplete"> ") Can't bind to 'file' since it isn't a known property of 'mat-file-upload'.
  7. If 'mat-file-upload' is an Angular component and it has 'file' input, then verify that it is part of this module.
  8. If 'mat-file-upload' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
  9. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("ploadedSuccessfully && !isComplete"> <mat-file-upload (onUpload)="onUpload($event)" [ERROR ->][file]="file" [id]="i" *ngFor="let file of fileUploadQueue.files; let i = index"></") 'mat-file-upload' is not a known element:
  10. If 'mat-file-upload' is an Angular component, then verify that it is part of this module.
  11. If 'mat-file-upload' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("httpUrl]="url"> <div ngIf="!hasUploadedSuccessfully && !isComplete"> [ERROR ->]<mat-file-upload (onUpload)="onUpload($event)" [file]="file" [id]="i" ngFor="let f") 'mat-file-upload-queue' is not a known element:
  12. If 'mat-file-upload-queue' is an Angular component, then verify that it is part of this module.
  13. If 'mat-file-upload-queue' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
[ERROR ->]
thanhvt commented 4 years ago

Anyone has fix for this ???

ishamfazal commented 4 years ago

does anyone has a solution for this? apart from using this command ng build --prod --aot=false --build-optimizer=false . thanks in advance