vue-fragment icon indicating copy to clipboard operation
vue-fragment copied to clipboard

vue-fragment breaks prerender-spa-plugin

Open srchulo opened this issue 6 years ago • 1 comments

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.

srchulo avatar Mar 02 '19 18:03 srchulo

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

OmgImAlexis avatar Mar 02 '19 23:03 OmgImAlexis