Skip to content

Error - dom.hasAttribute is not a function #768

Discussion options

You must be logged in to vote

I have fixed it! I needed to delve a bit deeper into the ProseMirror schema. I'm leaving my solution here hoping it might benefit someone in the future. I had wrongly assumed that the parseDOM and toDOM methods were useless, obviously they aren't. Guess I'm a bit overworked. So if you have a similar problem check out the toDOM and parseDOM methods and the div in which the component is wrapped.

Image.js

import { Node, Plugin } from 'tiptap';

import ServerImage from "~/components/images/ServerImage";

export default class ImageNode extends Node {

  get name() {
    return 'image'
  }

  get schema() {
    return {
      inline: true,
      attrs: {
        hash: {}
      },
      group: '…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hanspagel
Comment options

Answer selected by riccardostokker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants