mclintprojects / actioncable-vue

A Vue plugin that makes integrating Rails Action Cable dead-easy.
MIT License
181 stars 38 forks source link

After import actioncable-vue: ReferenceError: self is not defined #51

Closed phlegx closed 4 weeks ago

phlegx commented 3 years ago

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:

  1. 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

ggraca commented 3 years ago

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.

bmulholland commented 11 months ago

See also https://github.com/rails/rails/pull/47939