tiptap: [Bug]: Tiptap 2.5.0-beta.3 can lead to multiple versions of prosemirror-model

Affected Packages

pm

Version(s)

2.5.0-beta.3 (and possibly earlier 2.5.0-beta.x)

Bug Description

prosemirror-model@1.21.0 and prosemirror-model@1.21.1 can both end up installed, which breaks a lot of thing.

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

A single version of prosemirror-model should be installed.

Additional Context (Optional)

❯ yarn why prosemirror-model
yarn why v1.22.22
[1/4] Why do we have the module "prosemirror-model"...?
[2/4] Initialising dependency graph...
[3/4] Finding dependency...
[4/4] Calculating file sizes...
=> Found "prosemirror-model@1.21.1"
info Has been hoisted to "prosemirror-model"
info Reasons this module exists
   - Hoisted from "prosemirror-schema-list#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-commands#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-gapcursor#prosemirror-model"
   - Hoisted from "prosemirror-schema-list#prosemirror-state#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-schema-basic#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-markdown#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-view#prosemirror-model"
   - Hoisted from "prosemirror-schema-list#prosemirror-transform#prosemirror-model"
   - Hoisted from "@tiptap#pm#prosemirror-tables#prosemirror-model"
info Disk size without dependencies: "564KB"
info Disk size with unique dependencies: "604KB"
info Disk size with transitive dependencies: "604KB"
info Number of shared dependencies: 1
=> Found "@tiptap/pm#prosemirror-model@1.21.0"
info This module exists because "@tiptap#pm" depends on it.
info Disk size without dependencies: "564KB"
info Disk size with unique dependencies: "604KB"
info Disk size with transitive dependencies: "604KB"
info Number of shared dependencies: 1
=> Found "@tiptap/pm#prosemirror-schema-list#prosemirror-model@1.21.1"
info This module exists because "@tiptap#pm#prosemirror-schema-list" depends on it.
info Disk size without dependencies: "564KB"
info Disk size with unique dependencies: "604KB"
info Disk size with transitive dependencies: "604KB"
info Number of shared dependencies: 1

Dependency Updates

  • Yes, I’ve updated all my dependencies.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (15 by maintainers)

Most upvoted comments

You may not be hitting it if you don’t use the “style” tag for parsing HTML which is where we running into issues in our tests for example in this extension: https://github.com/ueberdosis/tiptap/blob/b941eea6daba09d48a5d18ccc1b9a1d84b2249dd/packages/extension-underline/src/underline.ts#L52-L56

So Tiptap cannot upgrade to prosemirror-model@1.21.1 since it breaks other users who may be relying on that functionality. So I attempted to specify in the @tiptap/pm package that it should only use prosemirror-model@1.21.0 but because prosemirror-schema-list is separately depending on prosemirror-model https://github.com/ProseMirror/prosemirror-schema-list/blob/master/package.json#L27 it seems to be trying to resolve that dependency independently of what we specified it as: https://github.com/ueberdosis/tiptap/blob/0e96a2c35e7ccd83c055cbbf9eaf8c71d03cdf13/packages/pm/package.json#L139

Dependency resolution can be difficult & it is unfortunate that there isn’t much that we can do in this situation. I hope that @marijnh can get to it at some point. A patch release should not break users.

Can you check this again, there have been several releases on top of that version now.

This can’t possibly be an issue with tiptap anymore because it is specifying a version range that should work now. So now this squarely an issue with your package-lock and just needs to be upgraded or regenerated

Hopefully resolved with: v2.5.0-beta.6 now that the issue is resolved upstream

I did have to do a bunch of package lock changes afterward so let me know if there is anything wrong & I can re-release another ontop of it

@Nantris Happy to hear that all of your tests passed though!

Hm, I may have to revert it all together then. I found that prosemirror-model had an accidental breaking change in 1.21.1 which I reported here: https://github.com/ProseMirror/prosemirror/issues/1473

Thanks for bringing it up