actioncable-vue
actioncable-vue copied to clipboard
After import actioncable-vue: ReferenceError: self is not defined
Describe the bug
I use a SSR environment (not Nuxt). If I import actioncable-vue I get this error: ReferenceError: self is not defined
To Reproduce Steps to reproduce the behaviour:
- Follow install instructions from actioncable-vue.
Expected behaviour I'm not able to conditionally import actioncable-vue (e.g. only for the client).
Plugin version (please complete the following information):
Version: 2.4.6 Vue: 2.6.12 SSR: uvue
I was running into the same issue with vitejs and solved it by only calling Vue.use(ActionCableVue, actionCableConfigs)
from the client entry point enty-client.js
instead of in app.js
.
I don't know uvue very well, check if you can do something similar there.
Not sure if this should or can be handled by the plugin itself, I'll let the maintainers answer that.
See also https://github.com/rails/rails/pull/47939