Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find @ckeditor/ckeditor5-build-classic in angular 8 #122

Closed
rajrs opened this issue Jun 28, 2019 · 11 comments
Closed

cannot find @ckeditor/ckeditor5-build-classic in angular 8 #122

rajrs opened this issue Jun 28, 2019 · 11 comments
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:question

Comments

@rajrs
Copy link

rajrs commented Jun 28, 2019

//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

@Mgsy
Copy link
Member

Mgsy commented Jun 28, 2019

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.

@rajrs
Copy link
Author

rajrs commented Jun 28, 2019

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)

@Mgsy
Copy link
Member

Mgsy commented Jun 28, 2019

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

@rajrs
Copy link
Author

rajrs commented Jun 28, 2019

same issue in local environment
image

@Mgsy
Copy link
Member

Mgsy commented Jun 28, 2019

cc @ma2ciek

@ma2ciek ma2ciek transferred this issue from ckeditor/ckeditor5-build-classic Jul 5, 2019
@ma2ciek
Copy link
Contributor

ma2ciek commented Jul 5, 2019

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' {}

@ma2ciek ma2ciek added the pending:feedback This issue is blocked by necessary feedback. label Jul 5, 2019
@rajrs
Copy link
Author

rajrs commented Jul 5, 2019

image
its working, Thank u @ma2ciek

@vaibhaw1234
Copy link

yes

@Siddharth77
Copy link

@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.

@Siddharth77
Copy link

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

@yasminkasem66
Copy link

I ran into the same problem and the solution was to create file typings.d.ts file in my project root
and adding the following code into the typing file

declare module '@ckeditor/ckeditor5-build-classic' {
const ClassicEditorBuild: any;
export = ClassicEditorBuild;
}

1
2

@Reinmar Reinmar added resolution:resolved This issue was already resolved (e.g. by another ticket). and removed resolution:solved labels Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:question
Projects
None yet
Development

No branches or pull requests

7 participants