question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build failure due to upstream change in prosemirror-state on class Plugin

See original GitHub issue

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>[];

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

2reactions
upkey1010commented, Jun 22, 2022

@wetternest agree. we need an official way to solve this. not work around.

0reactions
DupontCcommented, Dec 2, 2022

I have already had a similar problem. The problem comes from a dependency of tui-editor which during installation takes the latest minor version of the prosemirror-transform library which is no longer or not yet compatible with tui-editor. To get around this problem I fixed the version of tui-editor in the package.json :

 {
  "overrides": {
          "tui-editor": {
           "prosemirror-transform": "1.4.1"
          }
  },
  "dependencies": {
	  "prosemirror-transform": "1.4.1",
	  "tui-editor": "1.4.10"
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug: Downstream job fails to update upstream pr #326 - GitHub
I have one job building PR's and it works great, updates commit status on GitHub as expected. It also triggers the downstream job...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found