Open yoelpc4 opened 3 years ago
Hi @yoelpc4 Thanks for reporting I will correct
Hi @yoelpc4 Try ^2.0.0-alpha.2
Hi @ricardogobbosouza
It seems that the @nuxtjs/laravel-echo plugin isn't calling connect method at all although I've logged in through nuxt auth.
nuxt.config.js
buildModules: [
...
'@nuxtjs/laravel-echo',
],
echo: {
authModule: true,
broadcaster: 'pusher',
cluster: 'ap1',
connectOnLogin: true,
disconnectOnLogout: true,
encrypted: true,
forceTLS: true,
key: '...',
optionsPath: './laravel-echo.options.js',
},
modules: [
...
'@nuxtjs/auth-next',
],
with the following laravel-echo.options.js
export default ({ $axios }) => ({
authorizer: (channel) => ({
authorize: (socketId, authorizerCallback) =>
$axios
.post('/backend/api/broadcasting/auth', {
channel_name: channel.name,
socket_id: socketId,
})
.then(({ data }) => authorizerCallback(false, data))
.catch((error) => authorizerCallback(true, error)),
}),
onAfterConnect() {
console.log('laravel echo connected')
},
})
Because the onAfterConnect hook is not invoked and I've checked out on pusher debug console there's no connection logs at all.
I get 401 Unauthorized error
Hi @yoelpc4 Sorry, had a problem with the options.
Try ^2.0.0-alpha.4
@ricardogobbosouza now it doesnt connect to my websocket server(laravel-websockets)
@radudiaconu0 Please provide a repository
@ricardogobbosouza
Hi @radudiaconu0 I couldn't even register for your application, I configured the frontend and the backend
https://github.com/radudiaconu0/cheermeapp-frontend/ https://github.com/radudiaconu0/cheermeapp-backend/
Always with error CSRF token mismatch
.
@ricardogobbosouza set domains from cheermeapp.test to localhost. In laravel app and nuxtapp
"@nuxtjs/laravel-echo": "^2.0.0-alpha.5",
"nuxt": "^2.14.12",
"@nuxtjs/auth-next": "5.0.0-1613647907.37b1156",
"pusher-js": "^7.0.3",
in nuxt.config.js:
echo: {
...
broadcaster: 'pusher',
authModule: true,
}
My connector is set to NullConnector
when I set authModule
to true
, But when I set it back to false, it's a PusherConnector again.
Am I doing something wrong?
Hello. Does not work for me either
When I set authModule to true, I get this error:
TypeError: Cannot read property 'bind' of undefined at Echo.watchAuthState (echo.js?38ae:55) at Echo._callee$ (echo.js?38ae:13) at tryCatch (runtime.js?96cf:63) at Generator.invoke [as _invoke] (runtime.js?96cf:293) at Generator.eval [as next] (runtime.js?96cf:118) at asyncGeneratorStep (asyncToGenerator.js?1da1:3) at _next (asyncToGenerator.js?1da1:25)
Having the same issue. Looks like v2 is buggy.
Having the same issue. Looks like v2 is buggy.
Yes. That's why I used v1
Hi @ricardogobbosouza I have these package versions
dependencies:
devDependencies
with the following nuxt config
As you suggest to install v2.0.0-alpha.1 on recent issue #47 along with nuxt auth next laravel sanctum strategy, it resulted ReferenceError "location is not defined" on this line: https://github.com/nuxt-community/laravel-echo-module/blob/7a5e78ac41f9bf27d0e1b38b86358f4f6d306bc0/src/runtime/echo.ts#L38