-
-
Notifications
You must be signed in to change notification settings - Fork 680
Closed
Labels
bugIncorrect or unexpected behavior in existing functionality.Incorrect or unexpected behavior in existing functionality.
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() });Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIncorrect or unexpected behavior in existing functionality.Incorrect or unexpected behavior in existing functionality.