Open dermitzos opened 11 months ago
Have you found a solution for this? running into the same issue when testing a simple custom command, i.e:
`
const CustomTextAlignExtension = Extension.create({
name: "customTextAlign",
addCommands() {
return {
setSmartTextAlign:
(alignment) =>
({ tr, dispatch, state }) => {
return this.editor.chain().focus().setTextAlign(alignment).run();
},
...
`
The function actually works, and currently just returns the call to TextAlign extension - setTextAlign.
However, I get the same error in console:
Have you found a solution for this? running into the same issue when testing a simple custom command, i.e:
` const CustomTextAlignExtension = Extension.create({ name: "customTextAlign", addCommands() { return { setSmartTextAlign: (alignment) => ({ tr, dispatch, state }) => { return this.editor.chain().focus().setTextAlign(alignment).run(); }, ... `
The function actually works, and currently just returns the call to TextAlign extension - setTextAlign.
However, I get the same error in console:
Are you using vue-compat with your project? Our solution was to rewrite our extension and use tiptap's onUpdate event rather than a custom ProseMirrorPlugin. Not sure if tiptap handles it differently. But this is a too generic error and maybe it's different.
Hi Thanks for your reply.
I'm using "vue": "^3.4.15", "@tiptap/vue-3": "^2.1.16", "vite": "^4.5.2"
within a Meteor project which I don't think should make a difference.
I'm trying to implement an extension that extends the TextAlign functionality, All I need is to do add a custom class to listItems when a BulletList is being text aligned. This only needs to happened when the user changes text alignment so I think running this on onUpdated is bit overkill. The error 'mismatched transaction' is very obscure, that's I was sure I'm missing something fairly basic but just can't figure it out.
Make sure EditorState is never wrapped in a Vue reactive proxy.
Which packages did you experience the bug in?
@tiptap/core, @tiptap/vue-3, @tiptap/extension-code-block-lowlight, @tiptap/pm
What Tiptap version are you using?
2.1.12
What’s the bug you are facing?
We have created a custom extension extending code-block-lowlight to support our language grammar. In this custom extension we have a ProseMirror plugin that adds a margin-left in the nodes that need it.
We were using tiptap with Vue 2 and we are transitioning our app to Vue 3, currently using vue-compat. Previously the above PM plugin was working correctly, but right now when
view.dispatch(tr)
is called we are getting an error:Any suggestions on how we can fix it? Maybe this is an issue with vue-compat or should we consider a different approach?
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
Dispatch the transaction successfully
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?