Mawi137 / ngx-image-cropper

An image cropper for Angular
MIT License
786 stars 210 forks source link

Module '"ngx-image-cropper"' has no exported member 'ImageCropperModule'.ts #647

Closed carbdias closed 1 day ago

carbdias commented 2 months ago

I'm having the following problem with Angular 16 and "ngx-image-cropper": "8.0.0", In the NgModule, the import of the module in underlined in red, saying : "Module '"ngx-image-cropper"' has no exported member 'ImageCropperModule'.ts"

I've tried importing BrowserModule and FormsModule too as stated here, but didn't solve the problem https://stackoverflow.com/questions/61139176/angular-8-ngx-image-cropper-is-not-an-angular-module-import-error

Do you know the cause of this? Am I using the wrong version of ngx-image-cropper with Angular 16?

Is it because it is looking for a module written in typecript ? ImageCropperModule'.ts ? How can I solve this ?

Thank you in advance,

Carlota

Mawi137 commented 2 months ago

Hi, since version 8, the module was removed. The cropper is now a standalone component so you only need to import imports: [ImageCropperComponent].

carbdias commented 2 months ago

Ok, Thank you for your quick response !! Just a remark, I've added to declarations, and not imports and then it seems to work at least it compiles now thank you.

carbdias commented 2 months ago

O no, false alarm, I still have this :

image

carbdias commented 2 months ago

Adding it inside the component worsens the compilation

@Component({ selector: 'app-org-sign-modale', templateUrl: './org-sign-modale.component.html', styleUrls: ['./org-sign-modale.component.scss'], imports: [ImageCropperComponent], })

Mawi137 commented 2 months ago

I'm not sure you can import them in @Component when it's not standalone. Adding it to the imports of the module where 'app-org-sign-modale' is declared should work.

faraz-ahmad-uft commented 2 months ago

I am facing the same issue in v8.0. Unfortunately, I downgraded it to v7 then my project started running.

tobigit commented 1 month ago

There is missing the standalone-property in the cropper-component. Therefore I can't import the component correctly in my module.

Mawi137 commented 1 month ago

I just tried with a fresh Angular 16 install (version 16.2.12) with image cropper version 8.0.0. Works fine with both modules and standalone components. So I have no idea what is going wrong for you guys.

To recap, since image cropper version 8, the ImageCropperModule no longer exists. You need to replace it in the imports with ImageCropperComponent.