Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"

1k Views Asked by At

Bug

[Vue warn]: Error in mounted hook: "TypeError: Class constructor Node cannot be invoked without 'new'"

app.vue

<template>
  <v-container>
    <tiptap-vuetify
      v-model="content"
      :extensions="extensions" />

  </v-container>
</template>
 
<script>

// import the component and the necessary extensions
import { TiptapVuetify, Heading, Bold, Italic, Strike, Underline, Code, Paragraph, BulletList, OrderedList, ListItem, Link, Blockquote, HardBreak, HorizontalRule, History ,TodoList,TodoItem} from 'tiptap-vuetify'
 
export default {
  // specify TiptapVuetify component in "components"
  components: { TiptapVuetify },

  data: () => ({
    content: `
      <h3>TIPTAP</h3>`,
    // declare extensions you want to use
    extensions: [
      History,
      Blockquote,
      Link,
      Underline,
      Strike,
      Italic,
      ListItem,
      BulletList,
      OrderedList,
      [Heading, {
        options: {
          levels: [1, 2, 3]
        }
      }],
      Bold,
      Code,
      HorizontalRule,
      Paragraph,
      HardBreak,
      TodoList,
      [TodoItem, {
        options: {nested: true}
      }],],  
  }),}
</script>

System information

  • OS: Windows10
  • version of Node.js:v14.15.1

Dependencies

  • "core-js": "^3.6.5",
  • "tiptap-vuetify": "^2.24.0",
  • "vue": "^2.6.11",
  • "vuetify": "^2.2.11"

repo

todo-List issue

1

There are 1 best solutions below

0
On BEST ANSWER

I think you can do the following to force tiptap to transpile.

# vue.config.js

transpileDependencies: [
    /[\\/]node_modules[\\/]tiptap.*/
],

The reason why we get this error is because we try to extend a native class with a transpiled class.

References: