cstefanache / angular2-img-cropper

Angular 2 Image Cropper
MIT License
364 stars 135 forks source link

Production AoT builds are throwing error with 0.8.2 #154

Closed naveedahmed1 closed 7 years ago

naveedahmed1 commented 7 years ago

After upgrading to 0.8.2 production build with AoT in Angular CLI, it throws the below error:

ERROR in Unexpected value 'ImageCropperModule in /node_modules/ng2-img-cropper/index.js' imported by the module 'FileUploadModule in /src/app/shared/file-upload/file-upload.module.ts'. Please add a @NgModule annotation. ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '\src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts

Can you please have a look?

surfercoder commented 7 years ago

I am having a similar error to @naveedahmed1:

ERROR in Can't export value ImageCropperModule in /Users/agustin/Documents/projects/surfercoder/arc10/node_modules/ng2-img-cropper/src/imageCropperModule.d.ts from SharedModule in /Users/agustin/Documents/projects/surfercoder/arc10/src/app/shared/shared.module.ts as it was neither declared nor imported!

ERROR in ./src/main.ts Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/agustin/Documents/projects/surfercoder/arc10/src' @ ./src/main.ts 4:0-74 @ multi ./src/main.ts

And the module is there and it is being exported.

Besides that, could you please run linter on your code? I am getting several warnings too :)

Thanks in advance.

phmello commented 7 years ago

getting this error after update to angular 4.0.0

yelgogogo commented 7 years ago

have the same issue with angular 4.0.0. I could do ng serve but noway with ng build --aot --prod

ERROR in Unexpected value 'ImageCropperComponent in C:/Users/huajinso/sakura/nod e_modules/ng2-img-cropper/src/imageCropperComponent.d.ts' declared by the module 'AppModule in C:/Users/huajinso/sakura/src/app/app.module.ts'. Please add a @Pi pe/@Directive/@Component annotation.

adamunchained commented 7 years ago

Using version 0.8.1 makes everything work again. We had same issue with AOT....and also after we upgraded to 4.0.0 - see my other comment #157

cstefanache commented 7 years ago

Working on it!

yelgogogo commented 7 years ago

@adamkundrat Thank for suggestion. I roll back to 0.8.1. It resolves this issue. But I have to use ImageCropperModule instead of ImageCropperComponent in @NgModule to avoid duplicate declaration issue.

cstefanache commented 7 years ago

Should be fixed in 0.8.4

Dzivo commented 7 years ago

I think it is still not working. I get this error

ERROR in Unexpected module 'ImageCropperModule in /Angular2/node_modules/ng2-img-cropper/src/imageCropperModu le.d.ts' declared by the module 'SharedModule in /shared.module.ts'. Please add a @Pip e/@Directive/@Component annotation.

ng serve works but when i try:

ng build --aot --prod --env=prod

it fails

andrebaltieri commented 7 years ago

Same issue here, using 0.8.8 (Also tried 0.8.1 and 0.8.4)

asicerik commented 6 years ago

Is there any progress on this? It is still failing for me too. Tried 0.9, 0.8.1

tonyashah commented 6 years ago

Any update / or thoughts on how to work around this? Still seeing with 0.10.4...