You can create a plugin for this @Paperasse
nuxt.config.js:
module.exports = {
plugins: [
{ ssr: false, src: '~plugins/hello' }
]
}
plugins/hello.js:
window.onNuxtReady(() => {
console.log('Nuxt.js is ready and mounted')
})
The ~ can be left off regular plugins, but is required for ssr:false plugins:
plugins: [
'plugins/bootstrap-vue.js', // <- Works
'plugins/scroll.js',
{ ssr: false, src: '~plugins/etc.js' }, // <- requries ~
]
Without the ~ in the ssr:false plugin, I was getting a runtime error about here:
}
// if childNode is not null, it means the actual childNodes list is
// longer than the virtual children list.
if (!childrenMatch || childNode) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' &&
typeof console !== 'undefined' &&
!hydrationBailed
) {
hydrationBailed = true;
console.warn('Parent: ', elm);
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
}
return false
}
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
You can create a plugin for this @Paperasse
nuxt.config.js:plugins/hello.js: