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?
<!--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/c184">#c184</a>)</em></sub></div>