1

I have a plugin (bootstrap-vue) that I want to initialize with Vue.use(). Right now, I use it in the client entry (inside router.onReady()), but I get the following warning:

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 <p>, or missing <tbody>. Bailing hydration and performing full client-side render.

I use server-side-rendering (SSR) and am not sure where to call the plugin initialization properly. Thanks!

2
  • 1
    trying to put Vue.use(yourPlugin) next to the entry point of your app. Commented May 7, 2018 at 16:21
  • Thanks, that solved it already! A detailed answer for others having this question follows. Commented May 8, 2018 at 10:45

1 Answer 1

1

Thanks to @Sphinx for the hint! The answer is to put it into the client (!) entry point of the Vue app, e.g. where new Vue() is called:

// Create the main Vue app
const app = new Vue({
    router,
    render: h => h(App)
})

// Register plugins
Vue.use(YourPlugin)

It will work properly with other SSR components of the Vue app.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.