jodit / jodit-react

React wrapper for Jodit
MIT License
370 stars 121 forks source link

Typescript Error: Type 'undefined' is not assignable to type 'IDictionary<IControlType<IViewBased | IJodit | IFileBrowser, IToolbarButton>>'. #116

Open kanke opened 3 years ago

kanke commented 3 years ago

Using the versions of "jodit-react": "^1.0.68", "react": "^16.9.0"and "typescript": "^3.9.6" but getting the below errors. Kindly assist

` ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts [tsl] ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts(28,13) TS1109: Expression expected.

ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts [tsl] ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts(33,7) TS2532: Object is possibly 'undefined'.

ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts [tsl] ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts(35,8) TS2532: Object is possibly 'undefined'.

ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts [tsl] ERROR in /node_modules/jodit/src/core/ui/helpers/get-control-type.ts(40,43) TS2345: Argument of type 'Controls | undefined' is not assignable to parameter of type 'Controls'. Type 'undefined' is not assignable to type 'IDictionary<IControlType<IViewBased | IJodit | IFileBrowser, IToolbarButton>>'. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. [ERROR] Command execution failed`

Anyone seeing this?

on2air commented 3 years ago

yes, also seeing this with version 1.0.70

itoumlilt commented 3 years ago

Got the same error with typescript@3.9.7, solved after upgrading to typescript@4.1.3

premls commented 3 years ago

Our other dependencies are failing if we upgrade typescript to 4.1.3. Can anyone please help me with jodit react version that works well with typescript ^3.9.5?