tui.editor: build failure due to upstream change in prosemirror-state on class Plugin
Describe the bug
With prosemirror-state moving from javascript to typescript in version 1.4.0 the number of generic arguments for the class Plugin changed to one (optional). After running npm update (which updates prosemirror-state to 1.4.0) this results in the following build errors for my project:
Error: node_modules/@toast-ui/editor/types/spec.d.ts:40:41 - error TS2707: Generic type 'Plugin<PluginState>' requires between 0 and 1 type arguments.
40 keymaps(useCommandShortcut: boolean): Plugin<any, any>[];
~~~~~~~~~~~~~~~~
Error: node_modules/@toast-ui/editor/types/editor.d.ts:315:47 - error TS2707: Generic type 'Plugin<PluginState>' requires between 0 and 1 type arguments.
315 createKeymaps(useCommandShortcut: boolean): Plugin<any, any>[];
~~~~~~~~~~~~~~~~
Fix
I fixed this by changing the according two lines as follows:
Plugin<any, any>[]; => Plugin<any>[];
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 18
Commits related to this issue
- Type fixes for #2551 #2552 @2926 — committed to woutervanoorschot/tui.editor by woutervanoorschot a year ago
I’m also facing this issue.
using
@wetternest agree. we need an official way to solve this. not work around.
This issue still happening !!
This is still happening
@AndrewBasiuk @wetternest Using this in an Angular project (with typescript v4.7.4) has long required me to include Prosemirror types in the project’s dev-dependencies for:
This worked until I just upgraded to the latest editor version (3.2.0), which now breaks with a number of errors (a couple more than @webmatth found 😬)
Fortunately, for now, downgrading to v3.1.10 fixes the errors.