sibiraj-s / ngx-tiptap

Angular bindings for tiptap v2
https://sibiraj-s.github.io/ngx-tiptap/
MIT License
128 stars 19 forks source link

Cannot reconcile build once Tiptap extensions are added #42

Closed Routhinator closed 1 year ago

Routhinator commented 1 year ago

Hey there, looking for some guidance on getting extensions into ngx-tiptap without tripping on myself here. I know the docs say "read the tiptap docs" - but doing that has led me to this and I cannot seem to resolve it.

Error: node_modules/@tiptap/pm/node_modules/prosemirror-view/dist/index.d.ts:215:9 - error TS2717: Subsequent property declarations must have the same type.  Property 'pmViewDesc' must be of type 'ViewDesc', but here has type 'ViewDesc'.

215         pmViewDesc?: ViewDesc;
            ~~~~~~~~~~

  node_modules/prosemirror-view/dist/index.d.ts:215:9
    215         pmViewDesc?: ViewDesc;
                ~~~~~~~~~~
    'pmViewDesc' was also declared here.

I've gone through the package.json for ngx-tiptap@9.0.1 and aligned my versions so that they are all at 2.0.4 and I have this:

    "@tiptap/extension-document": "2.0.4",
    "@tiptap/extension-heading": "2.0.4",
    "@tiptap/extension-paragraph": "2.0.4",
    "@tiptap/extension-placeholder": "2.0.4",
    "@tiptap/extension-text": "2.0.4",
    "ngx-tiptap": "9.0.1",

Yet it looks like somehow I have at least 6 versions of prosemirror-view being referenced in my resulting package.lock and that leads me to wonder if I've missed something in the directions because with that much variance in dependencies from packages that are all pinned to the same version series, it seems off...

image

Routhinator commented 1 year ago

I seem to have managed to resolve this now (don't know why I didn't think of it earlier) by installing "prosemirror-view": "^1.31.6" explicitly into my package.json - but is this expected? I note you don't seem to need this in ngx-tiptap

sibiraj-s commented 1 year ago

Glad you fixed it. Some of this issue happens while updating the packages either angular or tiptap. Leaving some takeaways from my earlier encounter with similar issue. The following helped solve the issue, the issue is not with the editor

Some ways to fix this.

if you'd like to use prosemirror packages consider using @tiptap/pm package instead so you don't get duplicate packages or need to keep up with prosemirror and tiptap updates. Its just a re-export of prosemirror-* packages

Closing this issue as this is not an issue with the package. Feel free to continue the conversation if required. Thank you.

Routhinator commented 1 year ago

Thanks for the tips, I'll try that.

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in the thread.