Tiptap: dom.hasAttribute is not a function error

Created on 18 Aug 2019  路  6Comments  路  Source: ueberdosis/tiptap

Describe the bug
Whenever I'm trying to add a custom view, I get an error dom.hasAttribute is not a function

Steps to Reproduce Example

  1. Add iFrame to content
  2. Add extension as per iframe example https://github.com/scrumpy/tiptap/blob/master/examples/Components/Routes/Embeds/Iframe.js

Expected behavior
Should work just like the example iframe embed https://tiptap.scrumpy.io/embeds

Environment

  • OS: Mac
  • Browser Chrome
  • Version 76.0.3809.100 (Official Build) (64-bit)
  • Mobile / Desktop: Desktop

Most helpful comment

@magpiedigital I solved by adding a local vue.config.js file with the following:

module.exports = {
  runtimeCompiler: true
};

see here: https://cli.vuejs.org/config/#runtimecompiler

got the info above from this: https://github.com/vuejs/vue-cli/issues/2754

i'm assuming this would necessary be for local dev only?

All 6 comments

please provide a codesandbox

curious I am having the same issue locally. I found this ticket, I setup a codesandbox: https://codesandbox.io/embed/tiptap-test-jq43u

and it works just fine there... will review package.json

@magpiedigital I solved by adding a local vue.config.js file with the following:

module.exports = {
  runtimeCompiler: true
};

see here: https://cli.vuejs.org/config/#runtimecompiler

got the info above from this: https://github.com/vuejs/vue-cli/issues/2754

i'm assuming this would necessary be for local dev only?

@dustingibbs 's solution is workable. And in NuxtJs, you can do that through the following:
nuxt.config.js

  build: {
          extend(config) {
              config.resolve.alias['vue'] = 'vue/dist/vue.common'
          }
  }

Confirmed! I had the exact same issue and setting runtimeCompiler: true fixed it.

I fixed the issue by importing the view from its own video.vue file with a <template lang="html"></template> section. Webpack will pre-compile the template this way without needing the runtimeCompiler setting. You can update the example today to work correctly without waiting for v2 release. I can do the pull request for it, if you would like me to - just write a message (one of the maintainers). I can document the issue in the PR as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

git-mischa picture git-mischa  路  3Comments

asseti6 picture asseti6  路  3Comments

winterdedavid picture winterdedavid  路  3Comments

unikitty37 picture unikitty37  路  3Comments

ageeye-cn picture ageeye-cn  路  3Comments