Schema keeps getting reset to some basic version

I’ve been trying to finish an Angular implementation that was started by a coworker, who decided to go with ProseMirror. I’m trying to get tables to work, but for some reason, everytime the dispatchTransaction callback runs, the schema for the doc is being replaced with a basic schema without the table nodes. I’ve been searching for a place where that happens, but it’s not coming from my code.

The only reference I could find to using a schema for tables involves extending the schema, I’ve assumed this wasn’t needed and I could put the nodes straight into my custom schema, could that be where I’m going wrong?

Is there a basic schema that overrides the custom schema under some circumstances? Can I force prosemirror to only ever use the custom one? I’ve removed the node_modules for prosemirror-schema-basic, so I know I’m not loading that one.

That sounds really weird. Especially since you cannot really use a document created in one schema with another schema, so if the document is surviving, some code is doing some real work to make this happen. One thing I’d look at is whether any code is defining a dispatchTransaction hook that does something odd with the transactions.

1 Like

For anyone with the same problem in the future, I figured out what was happening. A different part of the code was parsing content from the server and this created a new Schema when it was turned into a doc. It was using the defaultMarkdownParser and that uses the standard Schema.