-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.The issue or pull reuqest is related to the open source packages of Tiptap.
Description
Affected Packages
core
Version(s)
3.11.1
Bug Description
👋 folks! Just updated tiptip with all extensions from 3.11.0 to 3.11.1 and saw a blocking typescript error in CI. Here is a minimal reproduction:
import { ResizableNodeView } from "@tiptap/core";
import { Image } from "@tiptap/extension-image";
export const MyImage = Image.extend({
addNodeView() { // ← 💥
return ({ node, getPos }) => {
return new ResizableNodeView({
element: document.createElement("img"),
node,
getPos,
onCommit: () => undefined,
onUpdate: () => true,
});
};
},
});Type '(this: { name: string; options: ImageOptions; storage: any; editor: Editor; type: NodeType;
parent: ((this: any) => NodeViewRenderer | null | undefined) | null | undefined; }) =>
({ node, getPos }: NodeViewRendererProps) => ResizableNodeView' is not assignable to type
'(this: { name: string; options: ImageOptions; storage: any; editor: Editor; type: NodeType;
parent: any | null | undefined; }) => NodeViewRenderer | null | undefined'.
Call signature return types '({ node, getPos }: NodeViewRendererProps) => ResizableNodeView'
and 'NodeViewRenderer | null | undefined' are incompatible.
Call signature return types 'ResizableNodeView' and 'NodeView' are incompatible.
The types of 'contentDOM' are incompatible between these types.
Type 'HTMLElement | undefined' is not assignable to type 'HTMLElement | null'.
Type 'undefined' is not assignable to type 'HTMLElement | null'.ts(2322)
It does not need to be Image.extend. I tried Paragraph.extend and got the same result. The issue may be related to #6717, looking at the CHANGELOG.
Browser Used
Other
Code Example URL
No response
Expected Behavior
No TSC error for the above code, just as in 3.11.0
Additional Context (Optional)
No response
Dependency Updates
- Yes, I've updated all my dependencies.
Metadata
Metadata
Assignees
Labels
Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.The issue or pull reuqest is related to the open source packages of Tiptap.