i am playing around with the library and currently encountering this issue Schema is missing its top node type ('doc') while extending the schema with the following code.
import { schema } from "prosemirror-schema-basic";
import { Schema } from "prosemirror-model";
const extendedSchema = new Schema({
nodes: schema.spec.nodes,
marks: schema.spec.marks
});
I just ran into it, but I recalled an earlier thread where a similar issue happened so I immediately know. Can be fixed in a few ways, and is always external build set up fault. A simple alias on build to always resolve one orderedmap fixes it.
@marijn The resultant error is definitely opaque. And for the purposes of a library that I’d like to see adopted by as many people as possible, including those using LLMs, I propose that that area of the code have something of a check for this condition, similar to the other part of the code where you suggest that the modules might be different, iirc prosemirror-view or some other module, maybe state. The code past that if check gobbles up prototypes, and breaks the contract expected by prosemirror (string, obj, string, obj) etc.
Could be reliably detected, probably more sanely by you. It’s certainly not a big deal, and am OK if you don’t like the idea. My thoughts are simply that it could save other people time chasing their tail. I could propose a PR if you’d like, just let me know.