Hi there is currently a issue with importing and using the echo module in a plugin, a temporary workaround suggested by @ricardogobbosouza is to use the hook builder:extendPlugins.
A code example of this would look like the following:
// nuxt.config.js
modules: [
'@nuxtjs/laravel-echo',
{ handler: function() {
this.nuxt.hook('builder:extendPlugins', (plugins) => {
plugins.push('~/plugins/extend-echo.js')
})
}}
]
// ~/plugins/extend-echo.js
export default function ({ $echo }) {
// Echo should be defined here
console.log($echo)
}
Hi there is currently a issue with importing and using the echo module in a plugin, a temporary workaround suggested by @ricardogobbosouza is to use the hook
builder:extendPlugins
. A code example of this would look like the following: