-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: 2.2.0-rc.7 upgrade - "Error: Adding different instances of a keyed plugin (plugin$)" -- worked in 2.1.x #4704
Comments
I feel like this could be related to this: 55377eb Could you please send your output of |
Should be fixed with newest version (RC right now). |
@svenadlung I'm seeing this error now when I upgrade our repo from const editor = useEditor({
content: '',
extensions: [Document, Paragraph, Text],
})
|
@K3TH3R can you please provide a sandbox? |
@svenadlung I've been able to confirm now that deleting the |
@slapbox can you please recheck with the newest versions and cleaning up lock file if needed? Closing for now. |
@svenadlung I'm sorry for the delay on this. Unfortunately the issue persists in
I scoured our Regarding the idea it might be related to this commit, 55377eb, unfortunately we don't use that extension so that can't be the problem. Just to be sure I ran |
I'm happy to report some clue at least. I mapped over the
I was able to determine which plugin the duplicates were and assign them new names. Unfortunately that doesn't fix the error, it only changes it. Now instead we get:
|
I thought I made progress by assigning a
I've more or less confirmed now that this is caused by using If we remove our Previously we worked around this with an approach like: export const CodeBlockPrism = CodeBlock.extend(
(() => {
// ...
})
) But in |
@bdbch I think there has been some adjustments to .extend()/.configure() recently, right? I think we should check changes to narrow down the issue. |
I do believe I saw it mentioned in the changelogs some time back, but I was unable to find it when writing up my report. |
Could we get this issue re-opened just for clarity's sake? |
Folks, should this problem be exists at Which version should I use, that doesn't have this issue? |
@igorbrasileiro |
I changed all packages version at the codepen to 2.1.0 and 2.1.16, but at both versions i got the same issue. I'll try another approac. Thank you |
@igorbrasileiro in that case you're presumably experiencing a different bug, although I couldn't say what it might be. Best of luck. |
Yeah, i got it.. The esm.sh cdn resolve the @tiptap/core of internal package dependencies to the latest version. So, for example: @tiptap/react depends on @tiptap/extension-bubble-menu, that depends on @tiptap/core too, this last tiptap/core import points to the latest.
|
@slapbox do you have something in mind that fixes the tiptap bug? I can submit a PR to fix it. |
The problem with A possible workaround is instead of const MyExtensions = Extension.create({
addProseMirrorPlugins() { ... }
})
const ConfiguredExtension = MyExtension.configure({ option: '...' }) do const MyExtensions = Extension.create({
addProseMirrorPlugins() { ... }
})
const ConfiguredExtension = MyExtension.extend({
addOptions() {
...this.parent?.(),
option: '...'
}
}) (untested) |
@svenadlung has there been any update on this? I'd expect accidental breaking changes to get a little more attention than they seem to be getting and that makes me worried about there being no upgrade path for us. This issue has been open for almost 4 months now with hardly even an acknowledgement of the problem, much less a path to resolution. The longer these issues go on, the more likely that the solution becomes someone else's breaking change and then these problems end up locked in. Every week it seems more likely to me that we're going to be stuck on |
For those struggling to upgrade TipTap to the latest version, check if these packages are dependencies. If they are, try deleting them before upgrading TipTap. I successfully upgraded from version
|
Removing Eg |
Maybe related to #5136 |
We've just released 2.4.0 with this change. I'm not 100% certain that this is resolved by that, but hopefully it is! If someone could give me confirmation on whether it is resolved, I can close this issue |
Although we cannot use this version due to other unfixed regressions, I did give 2.4.0 a test. I'm sorry to say it does not fix the issue in my testing. Regardless, thank you very much for the follow-up @@nperez0111. I believe the best way to test for this issue is to use |
@Nantris what other regressions should I be looking into? |
Looks promising! Thanks for the attention on this @nperez0111! The biggest outstanding accidental breaking change I'm aware (perhaps not a proper regression) is #4862. It's possible I might discover more once that's fixed and we can upgrade, but until it is we're locked on I think the other regressions I'm aware of have been resolved by merged PRs besides #4862 and this issue. Also, not a regression, but if you have any advice on addressing #5166; I'd really like to see that resolved and would be happy to contribute - although I'm not sure where to begin with it - and especially unsure if it also affects Vue, which I'm not really familiar with. |
I've just released a beta that should resolve this: v2.5.0-beta.4 |
In My case, I'm facing this error only when I add a History Extension, By the way I installed v2.5.0-beta.4 and still getting error for History extension |
Hm, I thought I handled this. @kashanghori Can you show how you are using the history extension? |
|
@kashanghori so the reason this is happening for you is actually valid, the StarterKit comes with the history extension, to add options to it you have to use it like this: https://tiptap.dev/docs/editor/api/extensions/starter-kit#usage StarterKit.configure({
history: { depth: 50 },
}), Whereas this issue was erroring when doing a You've technically imported the history extension twice so the prosemirror error is valid. We could perhaps give a better error message to notify you of this but that is out of scope for this issue. |
It makes sense now. Thank you, @nperez0111 , for finding this. I was following the docs and didn't notice this. |
Confirming this is resolved in |
Which packages did you experience the bug in?
core
What Tiptap version are you using?
2.2.0-rc.7
What’s the bug you are facing?
This error appears for two plugins after upgrading, but we only call them once and there's no discernible difference between the problematic two and all the rest. Adding keys to the plugins doesn't help - it only changes the key in the error.
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
Upgraded editor doesn't throw mystery errors.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: