appleple / smartblock

intuitive block based wysiwyg editor built with React and ProseMirror
https://appleple.github.io/smartblock/
MIT License
308 stars 27 forks source link

Uncaught RangeError: Duplicate use of selection JSON ID cell #14

Open tech-milky opened 2 years ago

tech-milky commented 2 years ago

I follow this example:

import ReactDom from 'react-dom';
import React from "react";
import {SmartBlock} from "smartblock";

let html = document.currentScript.getAttribute('data-html');
let element = document.currentScript.getAttribute('data-element');
const extensions = [
    new Heading1()
];

var app = document.getElementById("hello");

ReactDom.render(
    <SmartBlock
        extensions={extensions}
        html={`<ul>
      <li>list item 1</li>
      <li>list item 2</li>
    </ul>`}
        onChange={({ json, html }) => { console.log(json, html);}}
    />, app);

and I have this error

Uncaught RangeError: Duplicate use of selection JSON ID cell
    at Function.jsonID (editor.js:57012:34)
    at Object../node_modules/smartblock/node_modules/prosemirror-tables/dist/index.js (editor.js:112042:28)
    at __webpack_require__ (editor.js:145477:42)
    at Module../node_modules/smartblock/lib/extensions/table/index.js (editor.js:110215:76)
    at __webpack_require__ (editor.js:145477:42)
    at Module../node_modules/smartblock/lib/extensions/index.js (editor.js:108961:64)
    at __webpack_require__ (editor.js:145477:42)
    at Module../node_modules/smartblock/lib/components/smart-block.js (editor.js:106010:70)
    at __webpack_require__ (editor.js:145477:42)
    at Module../node_modules/smartblock/lib/index.js (editor.js:110802:81)

Package.json "smartblock": "^1.0.8",

uidev1116 commented 2 months ago

@tech-milky

Thank you for reporting this issue. We have identified and fixed the problem. The code should now work correctly with the latest version of the smartblock package. Please update your package.json to use version 1.3.11 and try again. If you encounter any further issues, please let us know.