appleple / appleple/smartblock

Uncaught RangeError: Duplicate use of selection JSON ID cell

Open
#14 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
318
Forks
26
Avg merge
3m
Merged PRs (30d)
11

Description

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",

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided React example and the stack trace, then inspect smartblock/lib/extensions/table/index.js and the bundled prosemirror-tables dependency used by smartblock 1.0.8. Reproduce the error with the example and verify that loading SmartBlock no longer throws the duplicate selection JSON ID RangeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.