Skip to content

Error importing @blocknote/core due to missing __serializeForClipboard in prosemirror-view #1428

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

Closed
guillepujol13 opened this issue Feb 12, 2025 · 4 comments · Fixed by #1431
Labels
bug Something isn't working

Comments

@guillepujol13
Copy link

guillepujol13 commented Feb 12, 2025

Describe the bug
I get the following error when trying to import @blocknote/core:

../../node_modules/@blocknote/core/dist/blocknote.js
Attempted import error: '__serializeForClipboard' is not exported from 'prosemirror-view' (imported as 'et').

To Reproduce

  1. Install @blocknote/core in a project.
  2. Import and use @blocknote/core in a component.

Misc

  • Node version: 18.18.2
  • Package manager: yarn 1.22.21
  • React version: 18.2.0
  • Next.js version: 14.2.4
  • Browser: Chrome 133.0.6943.54
  • @blocknote/core version: ^0.16.0 (also tested with the latest version, issue persists)

Possible Cause
After investigating, it seems that this might be caused by the following change in prosemirror-view:
ProseMirror Commit

@guillepujol13 guillepujol13 added the bug Something isn't working label Feb 12, 2025
@mustafa5199
Copy link

I have faced the same issue. And it has a simple fix, as @blocknote/core is dependant on prosemirror-view library in there recent changes they have removed the method which is in use of @blocknote/core to resolve the issue I simply add the overrides object in package.json file and set the downgraded version for prosemirror-view package to 1.37.2
"overrides": { "prosemirror-view": "1.37.2" }

@guillepujol13
Copy link
Author

Thank you for your suggestion. In my case, adding the "overrides" section in package.json didn’t work, but I was able to resolve the issue using "resolutions" instead:
"resolutions": { "prosemirror-view": "1.37.2" }

@YousefED
Copy link
Collaborator

In version 1.38.0 of prosemirror-view, serializeForClipboard is now cleanly exported: ProseMirror/prosemirror-view@29f4053

We should move to this version as min. dependency and use the new method :)

(we'll ship a fix soon, in the mean time, @guillepujol13 's fix should work)

@ericchentch
Copy link

Thank you for your suggestion. In my case, adding the "overrides" section in package.json didn’t work, but I was able to resolve the issue using "resolutions" instead: "resolutions": { "prosemirror-view": "1.37.2" }

thank you @guillepujol13, this config works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants