-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Recent port of ProseMirror to TypeScript and ProseMirror version bumps (hours ago) break TipTap #2836
Comments
I would add that if the above proves correct, existing TipTap consumers should refrain from installs and updates of their |
A quick workaround for those facing the same issue is restricting the prosemirror dependencies to the previous minor version in your own package.json, e.g.
(There may be other transitive dependencies to prosemirror in your project that you have to adjust) |
@NeoDobby Unfortunately that doesn't work, since the TipTap core package uses it's own Have you managed to employ this solution, or is it theoretical? I don't really see a self-serve solution to this, unless you fork TipTap and change to fixed versions there, then use the fork in your host app. That's why I think this is pretty bad, there isn't really any workaround a consumer of the library can use. A fresh install of TipTap now uses an incompatible dependency, plain and simple, as far as I can tell, and that's not really solvable in a host project. There's not even the option to use an older version of TipTap, since the way ProseMirror versions are requested in I am of course open to any solutions in the meanwhile. |
@tgv1975 Yes, I tested this before posting. As long as your restricted Note: I tested this with npm 6 and 7, not sure if it also works with 8. But I agree, this is only a workaround until the issue is fixed properly. |
@NeoDobby I only now realize the nuance in your solution. That's clever. Will certainly try it. Thanks! |
@NeoDobby Unfortunately this trick doesn't seem to work on Node 16.15.0 For example, the In my app's Actual installed version: Is it possible that in your case there was some cache involved? PS: of course, there may be a difference between |
@tgv1975 you put |
Apologies, wrong screenshot. This is the actual lib in my It was there before, I just took the screenshot wrong. PS: I had copied all the dependencies verbatim from the TipTap core |
Having investigating this further, there is a way to mitigate it until a permanent solution emerges, when using WORKAROUND: Add the following
These dependencies are copied verbatim from the TipTap core The equivalent for This should only be a temporary workaround until the root cause is properly addressed in TipTap core. The good news about this workaround actually resolving the problem is that the actual definitive solution is really simple: just make core dependencies fixed version and republish TipTap. I think having fixed dependency versions is good practice anyway, gives the publisher full control over them. Even allowing patches can turn sour, as there is a gap between the publisher testing the package and users installing it on their machine, and if an incompatible patch in the dependency has been published in the meanwhile, there will be bugs and bug reports that could have been avoided. |
Thanks for this issue! We'll make sure to work on a port to the new Typescript version ASAP so we don't need workarounds here. I'll discuss this in the team and reproritize issues. |
BOSS @NeoDobby @tgv1975 - this was impacting v1 also! - thanks for sharing the above!!!!! 👍🏻 but your above notes allowed me to trace the different package dependencies Sub Modules
to then dedupe and create a what appears to be working overwrite in the package.json!!!
the above override idea may also have been a great solution for this one: #577 |
Still experiencing this issue with latest tiptap packages on npm. And I can confirm that overriding prosemirror packages works for now. |
@Lwrless you mean the typing issues described in the original issue screenshots? |
Yes, it was |
We haven't been able to update to the latest Tiptap versions either, but I'm still a bit unsure where the problem lies. We are not building our editor directly in the final apps, it's a custom package that it's then used in the final app. The custom package builds the distribution code with TypeScript (no babel or anything similar), and then is published to GitHub's Package Registry. The final app uses Webpack, and when I attempt to use a version of our package that includes the latest Tiptap versions, our web app breaks when opening a route that contains the editor component. I'm thinking it could be related to the ProseMirror package changes, and not exactly Tiptap's, but I have yet to dig deeper into this. |
@rfgamaral can you post your error message so I can try to reproduce those issues? |
At first, I got this, which doesn't tell us much: But that's because we have an error boundary for the whole app. After removing the error boundary, I got this: |
Mh thats weird. Could you check if you load a different Tiptap itself now comes with |
You can also hit me up on Discord if you want faster communication for those issues so we can get them resolved ASAP. |
I've seen a similar error with prosemirror-codemark - which is related to a mix of ESM and UMD builds. |
@benkroeger I'm having that exact issue with |
@bdbch My problem above is caused by |
Ah I see - so your issue is more related to codemark then. If I can help somehow to resolve this issue let me know. |
@rfgamaral no workaround that I know of. @bdbch I think the problem @rfgamaral described is not related to the this issue. |
I believe I worked around this issue on our side by adding this to our Webpack configuration:
Although probably unrelated to the issue at hand, since I've discussed this here, I thought it was best to share the workaround here too. |
The suggested fix above, of overriding the listed prosemirror packages, is not working for me. Is there a rough ETA on when this issue might be resolved? |
Are you having the same issue as @rfgamaral ? |
I can't seem to find a set of packages that works without build issues. I use NPM 6 and have the For example this set doesn't work:
Can anyone post a set of versions that works for you? |
Is this something that could be resolved with fixed-version peerDependencies in TipTap? |
I think so! We could do some evaluations and testing on how to make this whole dependency list easier to match up. We also thought about a different versioning model (for example having all tiptap-packages matched to one version instead of independent versions) but we won't change this until we're hitting 2.0.0. Right now I'd suggest to use the latest prosemirror and tiptap packages @christian-kolb - I guess you tried that already, what issues did you run into? |
Personally, I just ran into this with the extensions that are using
Latest Tiptap versions:
Note that I do not explicitly import Prosemirror anywhere in my project, but I current have the most recent prosemirror-state:
|
@bdbch I've tried multiple combinations, but to be sure and able to reproduce it, I tried them now again and here are the variants. Before the each test, I nuked the npm cache with TestsLatest without locked prosemirror versions No tiptap packages in the package.json, then copied them in at once and run
With it, I get exactly the same result as @dougalg:
Latest version with locked prosemirror versions Same set of tiptap packages but with locked versions of prosemirror like @rajwitt suggested:
With it I get the same result:
Deep diveWhen looking into the export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any, any>; Same goes with the floating menu: export declare const FloatingMenuPlugin: (options: FloatingMenuPluginProps) => Plugin<any, any>; When looking into the declare class Plugin<PluginState = any> { Manually overwriting them locally (just for debugging purposes) to the following, solves the problem: export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any>; But this of course is no solution. I don't know where those types are generated, because they are not part of the When looking into the history of the So to me it looks like the generation of the dist files has broken somehow and generates this invalid types. The |
types for prosemirror-* packages have previously been separted and only incorporated with the latest significant updates.
@christian-kolb this appears unlikely to me. |
@benkroeger I discussed and validated it with @bdbch on the weekend via Discord. The types are correct, but something went wrong in the release which lead to the wrong types being included. They will solve it with a new release for the relevant packages 🙂 EDIT: The problems are in the |
@benkroeger @dougalg The release was just triggered and I can now build everything successfully 🙂 |
That's great! I'm going to close the issue for now. Feel free to reopen if it's still an issue. |
@christian-kolb @bdbch I can confirm that my build now runs without errors with latest packages, thank you! |
there are still issues for me. the Also, @tiptap/core@2.0.0-beta.174 seems to have more type issues internally: |
well, apparently - since I don't have @bdbch issue can be closed again :) |
Thanks @benkroeger for letting me know. I think we still should improve the dependency management and versioning for tiptap to make it easier to find potential incompatibilities faster! |
This issue is still happening for me with Edit: This was just me mixing up the |
What’s the bug you are facing?
ProseMirror has been recently ported to TypeScript, and a few hours ago ProseMirror lib versions have been bumped.
Due to TipTap not using fixed dependency versions (for example, in core), when doing a clean install of TipTap now, the new ProseMirror libs are used, and they are incompatible with TipTap on the TypeScript side.
For example, when compiling something that uses TipTap, I now get typing errors like:
Here's a screenshot which is perhaps more readable than the above dump:
This makes a fresh TipTap install completely unusable, for both new users, and existing users who refresh their
node_modules
.Which browser was this experienced in? Are any special extensions installed?
Not a browser issue, this pertains to the installation/transpilation phase.
How can we reproduce the bug on our side?
Do a fresh install of TipTap. I'm using these:
Then, instantiate an editor, and transpile that code.
Can you provide a CodeSandbox?
N/A
What did you expect to happen?
A normal transpilation of the code using TipTap.
Anything to add? (optional)
I believe the quick solution to this is to set all ProseMirror dependencies to the last working fixed versions, thus reverting to normal, until there is time for TipTap to catch up with the ProseMirror TypeScript port. The latter will likely take a long time, during which TipTap installs are essentially unusable.
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: