React-quill: Problem with dependency on @types/quill

Created on 9 Oct 2018  路  8Comments  路  Source: zenoamaro/react-quill

When I install it with yarn add react-quill and import it in a typescript project with
import ReactQuill from 'react-quill'; or import * as ReactQuill from 'react-quill'; I get the following error:

Namespace '".../node_modules/@types/quill/index"' has no exported member 'DeltaStatic'.

react-quill 1.3.1 has dependencies on "quill": "^1.2.6" and "@types/quill": "*". A few days ago new type definitions for quill 2.0.0 have been released, so "@types/quill": "*" resolves to @types/quill 2.0.0 now which seems to be incompatible with quill 1.x.

I managed to fix it by putting

    "resolutions": {
        "@types/quill": "1.3.6"
    },

in our package.json to tell yarn which type definitions to pull.

I think react-quill should specify major/minor version for the dependency on @types/quill to match the dependency on quill to avoid this problem.

help wanted typescript

Most helpful comment

I spent a lot of time for this issue. This problem is related to incompatible versions of packages for quill. So, my solution:

"@types/quill": "^1.3.9" if you use TypeScript (and "esModuleInterop": true in tsconfig.json)
"quill": "^1.3.6",
"quill-delta": "3.4.3",
"react-quill": "1.2.7"

All 8 comments

Please fix this

Hello ? @zenoamaro ?

@darioseidl It looks like your workaround does not work for npm users, as resolutions is a yarn-only feature.

going into node_modules/react-quill/node_modules/@types and deleting the quill folder is a terrible workaround that fixes compile errors until the next time you npm install 馃槩

npm i -DE @types/[email protected]

I spent a lot of time for this issue. This problem is related to incompatible versions of packages for quill. So, my solution:

"@types/quill": "^1.3.9" if you use TypeScript (and "esModuleInterop": true in tsconfig.json)
"quill": "^1.3.6",
"quill-delta": "3.4.3",
"react-quill": "1.2.7"

PR welcome to fix this 馃槃

Thanks @daggmano and @alexkrolick, this is fixed in react-quill 1.3.3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

camliu89 picture camliu89  路  4Comments

InsectEater picture InsectEater  路  4Comments

gustavoelizalde picture gustavoelizalde  路  5Comments

alexkrolick picture alexkrolick  路  4Comments

Drejerdk picture Drejerdk  路  4Comments