'image-cropper' is not a known element error

See original GitHub issue

Hi,

at first thanks for this nice project! I wanted to create a component which allows me to upload and crop it afterwards.

I have a module for the ui components: ui.module.ts

import { NgModule } from '@angular/core';
import { ImageCropperModule } from 'ngx-image-cropper';
import { ImageUploadComponent } from './image-upload/image-upload.component';

@NgModule({
    imports: [
        ImageCropperModule
    ],
    declarations: [
        ImageUploadComponent,
    ],
    exports: [
        ImageUploadComponent,
    ]
})
export class UiModule { }

image-upload-component.html

<input type="file" (change)="fileChangeEvent($event)" />
<image-cropper format="png" (imageCropped)="imageCropped($event)" (imageLoaded)="imageLoaded()" (cropperReady)="cropperReady()" (loadImageFailed)="loadImageFailed()"></image-cropper>
<img [src]="croppedImage" />

Here I’m getting the error:

‘image-cropper’ is not a known element:

  1. If ‘image-cropper’ is an Angular component, then verify that it is part of this module.
  2. If ‘image-cropper’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.

When I’m importing the ImageCropperModule in the app.module.ts directly and then using the image-cropper component in the app.component.html then everything works well. What’s my fault with the extra module?

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
maxbauercommented, Oct 18, 2021

Ok, very strange. I restarted my vs code, recompiled the project and it works like expected 🙄

1reaction
Mawi137commented, Oct 17, 2021

I have no idea to be honest. Importing the ImageCropperModule in the module where the component is used, should be enough. Like you did.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'angular-cropper' is not a known element - Stack Overflow
html i get 'angular-cropper' is not a known element:' error. I have tried anything know, any help is highly appreciated. ionic3.
Read more >
ngx-image-cropper - npm
An image cropper for Angular. Latest version: 6.3.2, last published: 9 days ago. Start using ngx-image-cropper in your project by running ...
Read more >
A-l-y-l-e/Alyle-UI - Gitter
Result: "ERROR Error: Uncaught (in promise): Error: Template parse errors: 'ly-icon' is not a known element:" when the app loads. @Enlcxx - this...
Read more >
Image Cropper Angular Component - Alyle UI
Just crop image. Just crop the output image and it is not resized.
Read more >
Angular Error NG8001: is not a known element ... - YouTube
https://readdy.net/Notes/Details/1827Angular Error NG8001: 'mat-progress-spinner' is not a known element :Angular Error is an Angular ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found