Prosemirror-markdown with custom schema


I am new to prosemirror and came up with an error which I cannot figure out. I am using a custom schema and prosemirror-markdown as I have custom markup as well. When I am typing I see the error below looks like multiple versions of prosemirror-model were loaded. However, if I use defaultMarkdownParser everything is ok, my custom schema is not to blame, can look exactly the same as the one in prosemirror-markdown and I still receive an error. The check nodes instanceof Fragment fails although it should not.

let schema = new Schema(…); new EditorView(container, { state : EditorState.create({ doc: (new MarkdownParser(schema, …)).parse(markup) }) }) Uncaught RangeError: Can not convert <“Testing a boldd”> to a Fragment (looks like multiple versions of prosemirror-model were loaded) at Function.from ( at NodeType.create ( at NodeContext.finish ( at ParseContext.finish ( at DOMParser.parse ( at parseBetween ( at readDOMChange ( at DOMObserver.eval ( at DOMObserver.flush ( at (

Can you please help me with this one?

Fragment.from is receiving an object that looks like a Fragment but isn’t instanceof Fragment, so it’s raising that error, since bundlers loading multiple versions of the library has come up before. As such, the first thing you should do is ensure that this isn’t the case.

Apparently there is only one version, I will check it out again to see if I can figure out.

├─┬ prosemirror-markdown@1.4.4 │ └── prosemirror-model@1.9.1 deduped ├── prosemirror-model@1.9.1 ├─┬ prosemirror-schema-basic@1.1.2 │ └── prosemirror-model@1.9.1 deduped ├─┬ prosemirror-state@1.3.2 │ └── prosemirror-model@1.9.1 deduped ├─┬ prosemirror-transform@1.2.3 │ └── prosemirror-model@1.9.1 deduped └─┬ prosemirror-view@1.14.2 └── prosemirror-model@1.9.1 deduped

Providing the EditorView with domParser: DOMParser(schema) temporarily fixed the problem 2d ago, in the meantime I discovered the real cause and made sure I have only one prosemirror-*. Thank you.