Home

Issue: 215

Vue plugin integration

[issue link]

I’m in the process of developing a plugin for Vue and I’m using Nuxt to create the site/docs. My problem is that when I run the site locally in the dev server, everything works fine without errors, but when the exact same code runs on my gh-pages hosted site, I get an TypeError: Cannot read property 'somePluginProperty' of undefined. It seems like the plugin is being installed or used differently in the build bundle.

I tried using if (process.BROWSER_BUILD) but that did not solve the problem.

Interestingly, when I wrapped the Vue.use plugin installation code around window.onNuxtReady((), I started getting the same errors locally in the dev server that I saw in my gh-pages hosted site.

I’m not sure whether this is an Nuxt error or an error on my part. In any case, I saw an issue regarding how to integrate Vue Material with Nuxt, so in a more general sense, what are the steps necessary to make Vue plugins compatible with Nuxt?

This question is available on Nuxt.js community (#c184)