Ngx-Quill ERROR in Directive QuillEditorBase
Asked Answered
J

2

6

i followed the basic steps to set up ngx-quill. I installed ngx-quill and quill additionally afer some research. But I still get the same error.

ERROR in Directive QuillEditorBase in .../node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
Cannot determine the module for class QuillEditorBase .../node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.

I use the eidtor simply with <quill-editor></quill-editor>

The component where i use it is lazy-loaded. I added QuillModule.forRoot() to the imports of my main module and also tried it to add it to my lazy-loaded module instead. Then I tried to add it to both and I also tried to add it without forRoot(). The error stays the same. I dont know where I should add QuillEditorBase to the ngmodule.

What am I doing wrong? I have no custom configuration. I just installed it and wanted to try to get it wto work..

Josephson answered 16/5, 2020 at 13:35 Comment(1)
post the code for the module where you're declaring the compoennt trying to use it and the template code of the component where you're trying to use it, and the package.json dependencies... generally with issues like this, you want to simplify the problem and remove variables. first try to do it in your app module and app component, then move from there. My gut is telling me version mismatch here.Recidivate
J
0

Thanks @bryan60 for the hint. It was indeed a version mismatch. I installed the newest version of quill but was running on angular 8 which requires a quill version < 10 and is mentioned in their docs. I updated to Angular 9 and it worked.

Josephson answered 20/5, 2020 at 20:55 Comment(0)
H
6

I have the same exact issue

Date: 2020-07-27T07:45:39.650Z - Hash: 674c36d8cc4fe0a89c1d - Time: 39499ms
ERROR in : Directive QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts has no selector, please add it!
: Cannot determine the module for class QuillEditorBase in /Users/louie/Development/mobile/node_modules/ngx-quill/ngx-quill.d.ts! Add QuillEditorBase to the NgModule to fix it.
[ERROR] An error occurred while running subprocess ng.

Since I am using Ionic Cordova 4 with Angular ~8.1.2 and "quill": "^1.3.7", "ngx-quill": "^12.0.0".

I checked the documentation of quill and found this.

Compatibility to Angular Versions
Angular ngx-quill   supported
v10 >= 12.0.0   until Feb 24, 2022
v9  >= 8.0.0    until Aug 06, 2021
v8  >= 5.2.0, < 9   until Nov 28, 2020

So, in order to resolve the issue I have. I downgraded ngx-quill from v12.0.0 to 5.2.0. And it compiled successfully after.

Houghton answered 27/7, 2020 at 14:16 Comment(2)
Thanks Louie. I had the same problem and this solution worked. Now to upgrade to Angular 10 :)Talkingto
I did have to remove one import that I was using and update an event handler: import { EditorChangeContent } from 'ngx-quill' and changedEditor(event: EditorChangeContent) { became changedEditor(event: any) {Talkingto
J
0

Thanks @bryan60 for the hint. It was indeed a version mismatch. I installed the newest version of quill but was running on angular 8 which requires a quill version < 10 and is mentioned in their docs. I updated to Angular 9 and it worked.

Josephson answered 20/5, 2020 at 20:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.