-
-
Notifications
You must be signed in to change notification settings - Fork 635
Open
Labels
bugSomething isn't workingSomething isn't working
Description
When using the /image command in the default editor setup following the documentation, the image is not added, and the console displays the following error.
This issue occurs in both v0.41.1, v0.42.0.
According to the documentation, previewWidth: number = 512; is specified, but in the actual code, it was declared as undefined.
In the current version, applying the following temporary fix allowed the editor to work without any errors.
import {
BlockNoteSchema,
defaultBlockSpecs,
createCodeBlockSpec,
} from "@blocknote/core";
const createSchema = () => {
const blockSpecs = {
...defaultBlockSpecs,
image: {
...defaultBlockSpecs.image,
config: {
...defaultBlockSpecs.image.config,
propSchema: {
...defaultBlockSpecs.image.config.propSchema,
previewWidth: {
...defaultBlockSpecs.image.config.propSchema.previewWidth,
default: 512 as const,
},
},
},
},
codeBlock: createCodeBlockSpec({}),
};
return BlockNoteSchema.create({ blockSpecs });
};const editor = useCreateBlockNote({ schema: createSchema() });AntoLC
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working