question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Mentions] cannot remove mention with backspace

See original GitHub issue

If I try to delete mention, this error occurs:

Uncaught Invariant Violation: Unknown DraftEntity key.

I’ll try to create sample project later, if it’s necessary.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
nihauxcommented, Oct 19, 2016

I had the problem while working on a fork of the project. I had accidently run npm install in a plugin directory. There was two versions of draft-js: one in the root of the project, one in the plugin directory. So when I was creating a new entity in the /doc folder, it was creating an entity in the root draft-js library, and in the plugin it was trying to retrieve it from the local draft-js lib. I just deleted the local node_modules (in the plugin dir) and it worked.

3reactions
woodccccommented, Oct 19, 2016

@MarkNijhof,I got this error too.As @theuniverse said ‘the root cause is there are 2 modules of “DraftEntity” in the project’.My project had two modules.I find draft-js in ‘draft-js-mention-plugin/node_modules’ ,so, webpack build draft-js twice in bundle file.

You could update your draft-js as draft-js-mention-plugin use. These are dependencies draft-js-mention-plugin used.

  "dependencies": {
    "decorate-component-with-props": "^1.0.2",
    "draft-js": ">=0.8.1",
    "find-with-regex": "^1.0.2",
    "immutable": ">=3.8.1",
    "lodash.escaperegexp": "^4.1.2",
    "react": ">=15.2.1",
    "react-dom": ">=15.2.1",
    "union-class-names": "^1.0.0"
  },

so, I update draft-js to ‘>=0.8.1’

"dependencies": {
    "antd": "2.0.1",
    "chai-shallow-deep-equal": "^1.4.4",
    "classnames": "2.2.0",
    "deep-equal": "1.0.1",
    "draft-js": ">=0.8.1",
   …
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Outlook 2019: @Mentions] Backspace does not work as
The backspace feature only seems to work if the name is formatted as First Name Last Name. I have to manually select the...
Read more >
Backspace key do not delete mentions - Bug Reports - Anytype ...
Mentions cannot be deleted by backspace key. The text cursor disappears and nothing happens when trying to do delete a mention using backspace....
Read more >
Mentions list does not disappear after clearing out all ... - Drupal
After mentioning the @mention list does not go away even when text is fully cleared with backspace/delete key. The problem is in this...
Read more >
Contenteditable div - cannot delete inner HTML nodes with ...
Mentions inside input use span with contenteditable="false" like this: <span contenteditable="false" class="mention" data-id="user1"> ...
Read more >
Mobile: Unable to delete @mentions and links, once embedded ...
A button in the toolbar, that would remove content or something like this would be nice. Backspace on virtual keyboard often fails to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found