Static GitHub Issues

[1568] document undefined with type.js module

prev: Nested view transition help
next: [Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered content. This is likely caused by incorrect HTML markup, for example nesting block-level elements inside, or missing . Bailing hydration and performing full client-side render.

typed.js: https://github.com/mattboldt/typed.js/tree/9905c0b2d6b79a207211b818da63600d30af1212

I was trying to use typed.js in my pages/index.vue like this

// pages/index.vue <template>

<section> <div id="typedjs"></div> </section> </template>
<script> import Typed from 'typed.js'; var options = { strings: ["<i>First</i> sentence.", "&amp; a second sentence."], typeSpeed: 40 } var typed = new Typed("#typedjs", options); export default { data () { } } } </script>

But when I try to access the element, it says that the document is not found. Is there any way to solve this? Also, if there is a solution, where would be the best place that I should declare the "options" and instantiate a new Typed within exports default {} ?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1399">#c1399</a>)</em></sub></div>