Rosey/markdown-draft-js

Uncaught Invariant Violation: block is not a BlockNode

Closed this issue · 1 comments

Hi,

I was upgrading draft-js from 0.10.5 to 0.11.4 and then I received some errors in the console and my react-app crashed.
invariant.js:40 Uncaught Invariant Violation: block is not a BlockNode at invariant (http://localhost:3000/static/js/0.chunk.js:54726:15) at insertRawBlock (http://localhost:3000/static/js/0.chunk.js:35067:50) at http://localhost:3000/static/js/0.chunk.js:35109:5 at http://localhost:3000/static/js/0.chunk.js:112326:23 at List.__iterate (http://localhost:3000/static/js/0.chunk.js:111793:11) at OrderedMap.__iterate (http://localhost:3000/static/js/0.chunk.js:112325:23) at OrderedMap.forEach (http://localhost:3000/static/js/0.chunk.js:114185:19) at encodeRawBlocks (http://localhost:3000/static/js/0.chunk.js:35088:30) at convertFromDraftStateToRaw (http://localhost:3000/static/js/0.chunk.js:35143:26) at Object.DraftJsEditor.onChange (http://localhost:3000/static/js/main.chunk.js:5599:92) at Object.MediumDraftEditor._this.onChange (http://localhost:3000/static/js/0.chunk.js:95439:19) at DraftEditor._this.update (http://localhost:3000/static/js/0.chunk.js:98651:19) at editOnFocus (http://localhost:3000/static/js/0.chunk.js:104621:12)
and
The above error occurred in the <DraftJsEditor> component: in DraftJsEditor (at MessageForm.tsx:209) in form (created by Form) in Form (at MessageForm.tsx:208) in div (created by Segment) in Segment (at MessageForm.tsx:207) in MessageEditForm (created by ConnectFunction) in ConnectFunction (created by withI18nextTranslation(Connect(MessageEditForm))) in withI18nextTranslation(Connect(MessageEditForm)) (at Messages/index.tsx:513) in div (at Messages/index.tsx:511)

Does anyone have an idea what happened there? The error depends on the version and nodejs packages but I don't get it...

Rosey commented

I suspect this issue is not related to the markdown-draft-js library as this stack trace doesn't reference any code in this repo as far as I can see.

Just to double check/try to help out though: Are you able to paste some of your code from convertFromDraftStateToRaw ?

As you opened this issue several months ago I assume you have either solved the problem or moved on with your life 😆 sorry for the delay in replying. I'll close this out if I don't hear back within the next week 😄