Duplicate use of selection JSON ID cell

I have been trying to work on prosemirror-tables. Requirements are simple, clone paper’s table component([Paper - Dropbox](https://www.dropbox.com/paper or notion table))

Essentially, when you click inside the table the buttons get active, and when you click outside it gets removed. and the column drag to create new table columns. (if anyone have any example on this please share)

As I did with all my other components, I have build all my node views manually by forking prosemirror and then customizing them.

but when I am not able to fork tableEditing() plugin. When I fork each and everything from the prosemirror-tables to my codebase, it gives me an error known as

|- RangeError: Duplicate use of selection JSON ID cell (screenshot attached) Screenshot 2024-12-01 at 9 37 42 PM

Do you have any suggestions on how can I proceed?

This is what I am doing right now if it helps image

Here is the gist for the tableEditing file I have created:

This means you are loading multiple Selection subclasses that all try to register the cell ID for their JSON serialization format. Most likely, you have multiple instances of prosemirror-tables in your dependency tree, and are loading them at the same time. npm ls -a can sometimes show where these are coming from. Using npm, rather than yarn, generally fixes these errors. (Yarn is dumb about upgrading, and randomly duplicates packages.)

Thanks for responding so quickly. I think i have only one instance of prosemirror-tables.

I am trying to recreate tableEditing plugin (gist file attached in the original post) and whatever is being imported from prosemirror-tables i am importing that file as well.

I am not sure why this error still comes.

I am able to successfully fork columnResizing plugin, tableNodes, tableNodeView. but this “tableEditing” is throwing some error.

Do you think this is the right way to do things as i want to heavily customize prosemirror-tables??

Do you see any wrong practice used in the file attahced because there were a lot of TS errors when i copied the original files liek CellSelection, etc.

That doesn’t look like the output of npm ls -a though, since it doesn’t display transitive dependencies.

If you’ve copied the CellSelection implementation, that’d also produce this error.

Probably.

1 Like

Thanks for your help. I was using my locally cloned files but in my schema, i imported prosemirror-tables. That was causing the issue.

But now that i have removed application works fine but when i resize, it crashes. But hey, different error messages says that’s a progress!

Same here, getting this error on our WYSIWYG component out of the nowhere:

Mostly for the tables example:

index.js:178 Uncaught RangeError: Duplicate use of selection JSON ID cell
    at l.jsonID (index.js:178:19)
    at index.js:741:11

We use v2.6.6 and this code worked perfectly before, we didn’t change our code, config or version.

But did you upgrade dependencies? With yarn? That’ll reliably mess up your tree and you’ll have to clear your package lock to fix it. (Or use npm. I really recommend using npm.)

@zoltanszogyenyi, I had a whole discussion with you on this issue: [Bug]: index.js:178 Uncaught RangeError: Duplicate use of selection JSON ID cell · Issue #5913 · ueberdosis/tiptap · GitHub

Please don’t waste @marijn’s time

@nickthesick my intention is not to waste anyone’s time, I have posted this comment about the same time as I opened the issue on GitHub, neither were answered when I was posting these. You can consider the issue closed on my end.