KillerCodeMonkey / ngx-quill

Angular (>=2) components for the Quill Rich Text Editor
MIT License
1.77k stars 258 forks source link

`quill-editor.component.d.ts` has an unknown import in distribution files on npmjs.com `import("parchment").Registry` #1895

Closed Halanson closed 1 month ago

Halanson commented 1 month ago

I updated ngx-quill to 26.0.5 and quill to 2.0.2 via npm in my Angular 18.1.1 app. During TS compilation I always getting this error:

✘ [ERROR] TS2694: Namespace '"/app/node_modules/parchment/dist/src/parchment"' has no exported member 'Registry'. [plugin angular-compiler]
     node_modules/ngx-quill/lib/quill-editor.component.d.ts:55:79:
       55 │ ...import("@angular/core").InputSignal<import("parchment").Registry>;
          ╵                                                            ~~~~~~~~

I checked the source code on my node_moduls and this line exists as expected. I also checked this repository https://github.com/KillerCodeMonkey/ngx-quill/blob/master/projects/ngx-quill/src/lib/quill-editor.component.ts#L99 and the zip file of version 26.0.5 release, but there is no import. Using the code tab of the npmjs.com registry, I find the line the compiler blames about.

I searched npmjs.com for parchment. Looks like this is the document model for quilljs. According to my node_modeles folder, I have parchment installed but not required in my package.json.

I also did a clean install. Have I missed something? Thank you for your help!

KillerCodeMonkey commented 1 month ago

Maybe you have typings installed? But for quill v2 no extra typings should be installed?

Check the Demo repo. Maybe you find some differences there.

Halanson commented 1 month ago

I'm not really sure how I fixed this, but the issue is gone. I also removed the typings for quilljs but I also changed some type hints in my code. I guess the combination of both fixed the issue.

Thank you for your help.

sambalmueslie commented 1 month ago

I had the same issue. I solved it by

ArturQuirino commented 2 weeks ago

I was facing the same problem, but the tricks that were describe here did not solve my problem, although they helped me.

Some other inner projects on my application (libraries projects) had reference to typing. So a remove then and installed all packages again and then it worked.

KillerCodeMonkey commented 2 weeks ago

Did you checked out the Demo repo?

It is working there.

Maybe you have some old typings installed?

For quill 2.0 you do not need any additional typings to be installed. Even @types/quill v2 exist. They are not needed to be installed