Skip to content
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

GapCursor is breaking on import because it's id is loaded multiple times #3452

Closed
1 of 2 tasks
bdbch opened this issue Nov 25, 2022 · 2 comments
Closed
1 of 2 tasks
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@bdbch
Copy link
Member

bdbch commented Nov 25, 2022

What’s the bug you are facing?

While working on #3450 we realized that the GapCursor extension is now throwing an error as soon as it's imported into a Nuxt project. Not sure if this is also true for other implementations.

RangeError: Duplicate use of selection JSON ID gapcursor

Which browser was this experienced in? Are any special extensions installed?

Chrome, Firefox

How can we reproduce the bug on our side?

  1. Create a Nuxt.js project
  2. Create a editor component and import the @tiptap/extension-gapcursor extension
  3. Optional: Add it to the extensions array of your editor

You should be able to see a console error in your browsers console coming from the prosemirror-state package.

Can you provide a CodeSandbox?

No response

What did you expect to happen?

The editor should work upon importing @tiptap/extension-gapcursor

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@bdbch bdbch added the Type: Bug The issue or pullrequest is related to a bug label Nov 25, 2022
@bdbch
Copy link
Member Author

bdbch commented Nov 25, 2022

I'm trying to find out what is causing this. #3436 introduced imports for mjs, cjs and umd which leads to imports of the module version instead of the cjs version.

The problem now is that we have mixed imports to prosemirror-gapcursor inside the extension-gapcursor extension. Somehow the mjs but also cjs versions are loaded which leads to the plugin being called twice.

Image

Image

@bdbch
Copy link
Member Author

bdbch commented Nov 25, 2022

This should be resolved in version ^2.0.0-beta.204

@bdbch bdbch closed this as completed Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

1 participant