Plugins written in the pre 1.0 style - without the exported function runs before window.onNuxtReady
is set. Causing onNuxtReady
is not a function error messages.
Not sure if this is a design decision but it should be noted as a breaking change.
Works
export default function () {
if (process.BROWSER_BUILD) {
console.log(window)
console.log('onnuxtready defined', window.onNuxtReady)
}
}
Does not work
if (process.BROWSER_BUILD) {
console.log(window)
console.log('onnuxtready not defined', window.onNuxtReady)
}
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This bug report is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c710">#c710</a>)</em></sub></div>