Ckeditor5-angular: cannot find @ckeditor/ckeditor5-build-classic in angular 8

Created on 28 Jun 2019  路  10Comments  路  Source: ckeditor/ckeditor5-angular

//post component
import { Component, OnInit } from '@angular/core';
import * as ClassicEditor from '@ckeditor/ckeditor5-build-classic';

@Component({
  selector: 'app-post-editor',
  templateUrl: './post-editor.component.html',
  styleUrls: ['./post-editor.component.css']
})
export class PostEditorComponent implements OnInit {
public Editor = ClassicEditor;
  constructor() { }

  ngOnInit() {
  }

}

https://stackblitz.com/edit/ng-webstore?file=src%2Fapp%2Fpost-editor%2Fpost-editor.component.ts

created this project in stackbiltz and it is available in above url
error-ckeditor

solved question

All 10 comments

Hello, did you install a package in your project via npm i --save @ckeditor/ckeditor5-build-classic? If so, please provide some more details, like errors messages etc.

entire code is available in stackblitz https://stackblitz.com/edit/ng-webstore @Mgsy

error msg

 ERROR TypeError: this.editor.create is not a function
    at CKEditorComponent.createEditor (ckeditor.component.ts:239)
    at eval (ckeditor.component.ts:160)
    at ZoneDelegate.invoke (zone.js:391)
    at Zone.run (zone.js:150)
    at NgZone.runOutsideAngular (ng_zone.ts:218)
    at CKEditorComponent.ngAfterViewInit (ckeditor.component.ts:159)
    at callProviderLifecycles (provider.ts:569)
    at callElementProvidersLifecycles (provider.ts:541)
    at callLifecycleHooksChildrenFirst (provider.ts:529)
    at checkAndUpdateView (view.ts:375)

Are you running your project only in StackBlitz or this error occurs also in your local environment?

same issue in local environment
image

cc @ma2ciek

Hi @rajrs.

As I see the StackBlitz has a different tsconfig.json configuration.

You need to make a default import instead of the namespace import:

import ClassicEditor from '@ckeditor/ckeditor5-build-classic';

And for the missing declaration warning it's enough to create a typings.d.ts file and fill it with:

declare module '@ckeditor/ckeditor5-build-classic' {}

image
its working, Thank u @ma2ciek

yes

@rajrs Could you please help what exactly have you done over here.

  1. I have created a tsconfig.d.ts file as suggested by @Mgsy
  2. Able to get away with the problem which you're facing in red underline
  3. I'm facing problem with named Import under ClassicEditor now and not able to get through it.

I still feel it needs more attention and proper resolution.

Well ! I have resolved after following the steps by @ma2ciek, on 22 July 2019 comment.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dev199x picture Dev199x  路  5Comments

vvemuru picture vvemuru  路  10Comments

csimpi picture csimpi  路  5Comments

codertushar picture codertushar  路  8Comments

jorroll picture jorroll  路  5Comments