-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on Vue3 cannot set properties of undefined (setting '$socket') #323
Comments
so basically no vue 3 support yet |
I have also had to use @meroo36 solution to prevent this error. |
It seems although npm says it's v3.0.10 it doesn't have the last Vue 3 fix. When installing it's probably easier to: |
It's August 15th, 2022, and this error still persist even with me using Vue 3. Is anyone going to update the npm entry? |
I got same error with Vue 3, meroo36 solution works for me too. |
Problem still present to this day on Vue 3, meroo36's solution works. |
It works, thank you so much. |
In node_modules/vue-socket.io/dist/vue-socketio.js there is a line as:
{t.prototype.$socket=this.io,t.prototype.$vueSocketIo=this,t.mixin(n),i.info("Vue-Socket.io plugin enabled")}
I just changed the line as:
{t.config.globalProperties.$socket=this.io,t.config.globalProperties.$vueSocketIo=this,t.mixin(n),i.info("Vue-Socket.io plugin enabled")}
Simply changed "t.prototype"'s to "t.config.globalProperties"'s, and it works but don't know if it is the right solution.
The text was updated successfully, but these errors were encountered: