'Problems with ngx-quill installation

Im having this errors while compiling my project

Error: node_modules/ngx-quill/lib/quill-editor.component.d.ts:3:21 - error TS2614: Module '"quill"' has no exported member 'Delta'. Did you mean to use 'import Delta from "quill"' instead?

3 import QuillType, { Delta } from 'quill';


Error: node_modules/quill-delta/dist/Delta.d.ts:1:8 - error TS1259: Module '"C:/ProyectoAgroSintesis/AgroCMS/node_modules/fast-diff/diff"' can only be default-imported using the 'allowSyntheticDefaultImports' flag

1 import diff from 'fast-diff'; ~~~~

node_modules/fast-diff/diff.d.ts:20:1 20 export = diff; ~~~~~~~~~~~~~~ This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

I dont know how to fix this, I installed quill following quill instructions in npm page



Solution 1:[1]

I dont know why I have this errors but I solve them

For the first error I change the imports in the quill-editor.component.d.ts like this:

import QuillType from 'quill';
import Delta from 'quill';

For the second error I put the flag "allowSyntheticDefaultImports": true, in my tsconfig.json in the compilerOptions

Also I change the version of the ngx-quill, I had the 16.1.2 and I downgrade to the 15.0.0

Solution 2:[2]

To resolve this error for [email protected] and angular 13.1.2, you need to ensure you install the correct version of @types/quill and quill

  1. @types/quill v1.x -> npm i types/quill@1
  2. quill v1.x -> npm i quill@1

Detailed installed instructions can be found here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Chris
Solution 2 Rufaro Muchedzi