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.
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.
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"