Weird behaviour extending schemas

Hi,

I was trying to setup a simple example with the latest version (0.14.1) and I’m hitting a weird bug/misconfiguration.

I’m using a simplification of the code at https://github.com/ProseMirror/website/blob/master/src/demo/basic.js and the page throws an exception Every schema needs a 'doc' type. Which is weird because it’s just extending the base schema.

I tried following the code, and the culprit seems to be that OrderedMap.from doesn’t recognise the value as being an instance of OrderedMap (which it is! I can see it in the developer console) so the schema ends up being an OrderedMap with the keys content, find, get (ie. the methods in the OrderedMap class)… instead of the original schema keys (doc, paragraph, blockquote, …).

So it seems that somehow OrderedMap gets defined twice or something, and my code uses one definition, while the from method is using another definition. But I have no idea how to figure it out. Any ideas?

Are you using NPM 3 or some older version? If you search through your node_modules dir, do you seem multiple instances of prosemirror-model?

If not, any chance you’re requiring directly from an src/ directory somewhere?

Ah, of course. I don’t know how I didn’t make the connection. The editor is created now at least, thanks!

I seem to have some other problems, but it’s probably more PEBKAC. I’ll have a look…