Thunberg087 / vue-fragment

a very candide fragment component for Vue.js
http://jsfiddle.net/cdkn5wL3/
670 stars 51 forks source link

vue-fragment breaks prerender-spa-plugin #26

Open srchulo opened 5 years ago

srchulo commented 5 years ago

I'm trying to use vue-fragment in my App.vue when I'm prerendering my app. My App.vue looks like this:

<template>
    <fragment> 
        <p>Test.</p>
    </fragment>
</template> 

<script>
import { Fragment } from 'vue-fragment'

export default {
    name: 'App',
    components: {
        Fragment
    }
}
</script> 

However, whenever I load index.html in my built dist directory, I get this error:

TypeError: Cannot read property 'insertBefore' of null
    at a.mounted (vue-fragment.esm.js:1)
    at Ht (vue.esm.js:1863)
    at nn (vue.esm.js:4203)
    at Object.insert (vue.esm.js:3141)
    at x (vue.esm.js:6322)
    at xn.__patch__ (vue.esm.js:6541)
    at xn.t._update (vue.esm.js:3929)
    at xn.hn.before (vue.esm.js:4050)
    at hn.get (vue.esm.js:4453)
    at new hn (vue.esm.js:4442)

And then none of the Vue js seems to work at all.

OmgImAlexis commented 5 years ago

That’s to be expected as this plugin modifies the DOM.