-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Error: Looks like multiple versions of prosemirror-model were loaded #445
Comments
hey @ThePaulMcBride, thanks for the report and especially for the replit :) I think this is caused by the transformer including @tiptap/starter-kit, which includes a few tiptap deps which then include prosemirror directly (not using peerDep). Linking ueberdosis/tiptap#3209, which I've raised with the team. Refs #417 |
I will just add this detail here because it is likely to be relevant for others who run into this problem. Webpack can be a bit dumb sometimes and it might end up building your app with both an esm and cjs copy of some prosemirror, yjs or tiptap library. These will also act like duplicate packages and there is no possible resolution with npm. If you do face this problem your best friend will be webpack aliases which can be used to force usage of either esm or cjs. I am unsure about solutions for other build systems. |
I've update this demo to the latest versions of Tiptap and Hocuspocus, but the error is idential. I'm also pretty sure it doesn't use a bundler at all. What would the fix be for this? https://replit.com/@ThePaulMcBride/HocuspocusTransformerError |
@ThePaulMcBride I wrote this script for myself to find duplicate prosemirror packages in the npm modules.
I believe the newest release of tiptap should be using peerDependencies now so you should be able to manually install the specific versions of the packages that you want. You should also use If you are not using npm workspaces to manage your project then you will likely be able to resolve any remaining issues with npm overrides. If the script comes up clean and you still run into issues then it is likely an esm/cjs issue which would require a build system solution like the webpack aliases I referred to earlier. |
Description
I'm having an issues with @hocuspocus/transformer. I am giving a valid minimal schema with valid content but I'm getting errors about duplicate imports of prosemirror-model.
Steps to reproduce the bug
I've created a little sandbox app, heres the link: https://replit.com/@ThePaulMcBride/HocuspocusTransformerError#index.js
Just run the app and you'll see the issues.
Expected behavior
It should return a yjs doc
Screenshot, video, or GIF
Additional context
This seems like it has been mentioned before, but the issue has been closed on the TipTap repo despite ongoing conversation.
ueberdosis/tiptap#577
The text was updated successfully, but these errors were encountered: