ngx-quill: Module errors
Upgraded to the latest version 8.1.5 and could no longer build the project Using Angular 9.1.2
Had to downgrade to “ngx-quill”: “^8.1.3” and everything built with no errors.
Time: 29789ms
: Compiled successfully.
95% emitting CopyPlugin
ERROR in node_modules/ngx-quill/src/quill.d.ts:2:24 - error TS7016: Could not find a declaration file for module 'quill-delta'. 'C:/Users/Pedro Rivera/Documents/Deveopment/USSI/e-solutions/node_modules/quill-delta/lib/delta.js' implicitly has an 'any' type.
Try `npm install @types/quill-delta` if it exists or add a new declaration (.d.ts) file containing `declare module 'quill-delta';`
2 import Delta = require('quill-delta')
~~~~~~~~~~~~~
node_modules/ngx-quill/src/quill-editor.component.d.ts:92:39 - error TS7016: Could not find a declaration file for module 'quill-delta'. 'C:/Users/Pedro Rivera/Documents/Deveopment/USSI/e-solutions/node_modules/quill-delta/lib/delta.js' implicitly has an 'any' type.
Try `npm install @types/quill-delta` if it exists or add a new declaration (.d.ts) file containing `declare module 'quill-delta';`
92 textChangeHandler: (delta: import("quill-delta"), oldDelta: import("quill-delta"), source: string) => void;
~~~~~~~~~~~~~
node_modules/ngx-quill/src/quill-editor.component.d.ts:92:72 - error TS7016: Could not find a declaration file for module 'quill-delta'. 'C:/Users/Pedro Rivera/Documents/Deveopment/USSI/e-solutions/node_modules/quill-delta/lib/delta.js' implicitly has an 'any' type.
Try `npm install @types/quill-delta` if it exists or add a new declaration (.d.ts) file containing `declare module 'quill-delta';`
92 textChangeHandler: (delta: import("quill-delta"), oldDelta: import("quill-delta"), source: string) => void;
~~~~~~~~~~~~~
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 37 (15 by maintainers)
just use the correct version of @types/quill…
v2 is for quilljs 2… so just use the latest 1.x version
I’m having a similar issue. Everyhting works fine but I have this errors during build :
ERROR in node_modules/ngx-quill/lib/quill-editor.component.d.ts:3:34 - error TS7016: Could not find a declaration file for module 'quill'. '/Users/chloe/DevTom/centaurus-frontend/node_modules/quill/dist/quill.js' implicitly has an 'any' type. Trynpm install @types/quillif it exists or add a new declaration (.d.ts) file containingdeclare module ‘quill’;`3 import QuillType, { Delta } from ‘quill’; ~~~~~~~ node_modules/ngx-quill/lib/quill-view.component.d.ts:1:23 - error TS7016: Could not find a declaration file for module ‘quill’. ‘/Users/chloe/DevTom/centaurus-frontend/node_modules/quill/dist/quill.js’ implicitly has an ‘any’ type. Try
npm install @types/quillif it exists or add a new declaration (.d.ts) file containingdeclare module 'quill';1 import QuillType from ‘quill’;
I tried to install @types/quill but now I have more errors :ERROR in node_modules/@types/quill/node_modules/quill-delta/dist/Delta.d.ts:1:8 - error TS1259: Module ‘“/Users/chloe/DevTom/centaurus-frontend/node_modules/@types/quill/node_modules/fast-diff/diff”’ can only be default-imported using the ‘allowSyntheticDefaultImports’ flag1 import diff from ‘fast-diff’; ~~~~
node_modules/@types/quill/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. node_modules/ngx-quill/lib/quill-editor.component.d.ts:3:21 - error TS2614: Module ‘“…/…/@types/quill”’ has no exported member ‘Delta’. Did you mean to use ‘import Delta from “…/…/@types/quill”’ instead?
3 import QuillType, { Delta } from ‘quill’; ~~~~~
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ ** 70% building 213/213 modules 0 active
ERROR in node_modules/@types/quill/node_modules/quill-delta/dist/Delta.d.ts:1:8 - error TS1259: Module ‘“/Users/chloe/DevTom/centaurus-frontend/node_modules/@types/quill/node_modules/fast-diff/diff”’ can only be default-imported using the ‘allowSyntheticDefaultImports’ flag
`
For anyone that finds this in the future, the issue is if you are using
ng servethe install of @types/quill doesnt seem to be detected until you restart theng serve. Just reserve and the error goes awayIm using angular 13 here: “@angular/core”: “~13.0.0”, “quill”: “^1.3.7”, “ngx-quill”: “^14.3.0”, devDependencies: “@types/quill”: “^1.3.10”,
right… as i said… v1 typings are for v1 quill… and v2 for v2… so this is how it is written in the readme and how i explained it now multiple times 😉
The part in the readme: Install @angular/core, @angular/common, @angular/forms, @angular/platform-browser, quill v1.x, @types/quill v1.x and rxjs - peer dependencies of ngx-quill
@pedrojrivera i found out why it was working in my demo repo: there i am using
@types/quill, which is installing both needed depsOkay. Because i do Not Need to add typings in ngx-quill and ngx-quill-example.
Could you try to Just Install quill-delta?
Pedro notifications@github.com schrieb am Sa., 18. Apr. 2020, 19:54: