-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Bug]: index.js:178 Uncaught RangeError: Duplicate use of selection JSON ID cell #5913
Comments
This is likely because you are trying to import from esm.sh and the table-cell extension is being included multiple times. There are known issues with the packaging with ESM because it cannot handle peer dependencies in the way that we are using them |
Hey @nperez0111, Thanks for the feedback, but this code worked perfectly one week ago and we haven't changed a thing. Every other import ESM example works, you can check the link here: https://flowbite.com/docs/plugins/wysiwyg/#default-text-editor So this seems to be a table specific error. I've been debugging this for over 2 hours and there's nothing wrong with our code AFAIK. |
Peer deps would be resolved separately since you don't have a lockfile to make sure it (and other deps) stays on a specific version. We make extensive use of peer dep ranges which would allow new versions of tiptap packages and 3rd party deps like prosemirror sneak in. |
But all our versions that are imported via ESM.sh are locked for |
That is not "locked", you are requesting a package's version. But, that package has dependencies & peer dependencies that too need to be resolved. So, esm.sh tries to resolve them for you. But, if you look at a package, it species a range as it's dependency version:
^2.7.0 means resolve the latest version that is in the major range 2, so, you get 2.10.1 because that is the latest we have released.
esm.sh cannot lock all of the dependencies in the tree, because it needs to refresh to satisfy those ranges. This is the purpose of a lockfile, to freeze a tree of dependencies in a known working state that can then be updated all at once. By using esm.sh you cannot make these guarantees. It is an anti-pattern |
Is there any way we can make this work via CDN? |
Again, this is an anti-pattern. I cannot make a recommendation for you because the approach is fundamentally flawed. |
Thanks, I'll see what I can do. Probably move the packages locally, too bad, CDN would've been a super comfortable approach. |
Actually, I do have a question: Is Tip Tap hosted on other CDN platforms other than ESM? I'm thinking that from there I can in fact actually lock in the versions. For example, at Flowbite we serve our dist JS via CDN too and it doesn't have to resolve packages since it's the final code that you import to make things work:
Thanks! |
Tiptap doesn't explicitly host themselves on ESM.sh, ESM.sh just happens to be able to import any NPM package and serve it. There could be a way of doing this with ESM.sh or another provider to lock it to a hash or something, but I don't know of how that all works. I would recommend bundling the packages you need for yourself and serve 1 JS file with all the dependencies in 1 file if you must. You could even bundle it into your library so it doesn't need to make extra network requests. But, this is outside what Tiptap can do, and again, this is an anti-pattern, so I cannot support it. |
Affected Packages
core, tables
Version(s)
2.6.6
Bug Description
Hey everyone,
We created a WYSIWYG component based on the Tip Tap library:
https://flowbite.com/docs/plugins/wysiwyg/#editing-tables
Everything worked perfectly and even though we haven't changed the code or versions, importing the table component throws an error that it seems that we can't fix on our end as it seems to be internal:
If I remove the import table from the code then the code works, but obviously the table actions won't get rendered.
This is the JS code on our end:
Any idea why this happens? We're importing via CDN, all the other examples work on our site.
Browser Used
Chrome
Code Example URL
No response
Expected Behavior
It should work and not throw an error.
Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: