# Duplicate use of selection JSON ID cell

**URL:** <https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984>\
**Category:** Uncategorized\
**Created:** [December 2, 2024, 1:02pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984 "2024-12-02T13:02:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rgupta](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rgupta](https://discuss.prosemirror.net/u/rgupta)\
**Post date:** [December 2, 2024, 1:02pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/1 "2024-12-02T13:02:52Z")

</div>

I have been trying to work on prosemirror-tables. Requirements are simple, clone paper’s table component([[Paper - Dropbox](https://dropbox.com/paper)]([https://www.dropbox.com/paper](https://t.co/hwJJ2Ww6IR) 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](https://github.com/user-attachments/assets/0b421796-2a5d-4981-967f-8da46f99f22a)

Do you have any suggestions on how can I proceed?

This is what I am doing right now if it helps ![image](https://github.com/user-attachments/assets/53f260d3-edce-4273-9a7d-101d86a09d99)

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

> <https://gist.github.com/rohitt-gupta/253ab1d0a654bee1da53cfb339c99a27>

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [December 2, 2024, 1:35pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/2 "2024-12-02T13:35:23Z")

</div>

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.)

---

<div class="post-metadata">

**Author:** ![rgupta](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rgupta](https://discuss.prosemirror.net/u/rgupta)\
**Post date:** [December 2, 2024, 1:50pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/3 "2024-12-02T13:50:02Z")

</div>

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

 ![Screenshot 2024-12-02 at 7.14.08 PM](https://discuss.prosemirror.net/uploads/secondsite/original/2X/9/94ce97ea25d833391908ff77fd62ceae5361a0d5.png)

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.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [December 2, 2024, 2:04pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/4 "2024-12-02T14:04:48Z")

</div>

> [@rgupta](#):
>
> I think i have only one instance of prosemirror-tables.

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

> [@rgupta](#):
>
> I am able to successfully fork […]

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

> [@rgupta](#):
>
> Do you think this is the right way to do things as i want to heavily customize prosemirror-tables??

Probably.

---

<div class="post-metadata">

**Author:** ![rgupta](https://discuss.prosemirror.net/letter_avatar_proxy/v4/letter/r/85f322/32.png) [@rgupta](https://discuss.prosemirror.net/u/rgupta)\
**Post date:** [December 2, 2024, 2:20pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/5 "2024-12-02T14:20:50Z")

</div>

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

 ![image](https://discuss.prosemirror.net/uploads/secondsite/original/2X/d/d45c44454b77bb684771d84b514c1719c7ea4d7a.png)

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!

---

<div class="post-metadata">

**Author:** ![zoltanszogyenyi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/zoltanszogyenyi/32/4366_2.png) [@zoltanszogyenyi](https://discuss.prosemirror.net/u/zoltanszogyenyi)\
**Post date:** [December 4, 2024, 1:38pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/6 "2024-12-04T13:38:44Z")

</div>

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

> **[Tailwind CSS WYSIWYG Text Editor - Flowbite](https://flowbite.com/docs/plugins/wysiwyg/)**
>
> Use the wysiwyg text editor component from Flowbite to create and modify content by manipulating paragraphs, headings, images and styling them using all available options

Mostly for the tables example:

> **[Tailwind CSS WYSIWYG Text Editor - Flowbite](https://flowbite.com/docs/plugins/wysiwyg/#editing-tables)**
>
> Use the wysiwyg text editor component from Flowbite to create and modify content by manipulating paragraphs, headings, images and styling them using all available options

```auto
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.

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [December 4, 2024, 1:39pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/7 "2024-12-04T13:39:48Z")

</div>

> [@zoltanszogyenyi](#):
>
> 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.)

---

<div class="post-metadata">

**Author:** ![nickthesick](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/nickthesick/32/4127_2.png) [@nickthesick](https://discuss.prosemirror.net/u/nickthesick)\
**Post date:** [December 4, 2024, 3:24pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/8 "2024-12-04T15:24:08Z")

</div>

@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](https://github.com/ueberdosis/tiptap/issues/5913)

Please don’t waste @marijn’s time

---

<div class="post-metadata">

**Author:** ![zoltanszogyenyi](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/zoltanszogyenyi/32/4366_2.png) [@zoltanszogyenyi](https://discuss.prosemirror.net/u/zoltanszogyenyi)\
**Post date:** [December 4, 2024, 3:40pm UTC](https://discuss.prosemirror.net/t/duplicate-use-of-selection-json-id-cell/7984/9 "2024-12-04T15:40:24Z")

</div>

@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.
