nishantmc / angular-material-fileupload

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

Not working in Angular 10.1.4 #66

Open jacques-hoventer opened 3 years ago

jacques-hoventer commented 3 years ago

I tried using it in an Angular 10.1.4 application - getting the following error when I build or try to run and watch the app:

ERROR in Failed to compile entry-point angular-material-fileupload (es2015 as esm2015) due to compilation errors: node_modules/angular-material-fileupload/fesm2015/angular-material-fileupload.js:596:26 - error NG1010: Value at position 0 in the NgModule.imports of MatFileUploadModule is not a reference Value could not be determined statically.

596 imports: [ ~ 597 MatProgressBarModule,

...
602                     CommonModule,

603 ],


  node_modules/angular-material-fileupload/fesm2015/angular-material-fileupload.js:597:21
    597                     MatProgressBarModule,
Unknown reference.
jacques-hoventer commented 3 years ago

PS. I have Angular Material installed

dobromyslov commented 3 years ago

Yep. Having the same error.

RoySijnesael commented 3 years ago

Same!

Edit: It is fixed by simply removing/commenting the Material Modules in the .js file, but that shouldn't be the permanent fix ofcourse.

kampytaru commented 3 years ago

This is happening because Angular Material 10 no longer allows barrel imports for its modules. I opened a PR to fix this problem but in the mean time, you can replace the module imports in fesm2015/angular-material-fileupload.js with:

import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatCardModule } from '@angular/material/card'; import { MatButtonModule } from '@angular/material/button';

jlweb58 commented 3 years ago

Same problem with Angular 9.0.7

arnaudprioul commented 3 years ago

Hi, I have same problem and it work (for local developpement) with :

import { MatIconModule } from '@angular/material/icon'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatCardModule } from '@angular/material/card'; import { MatButtonModule } from '@angular/material/button';

I hope your PR will be validate soon.