-
Notifications
You must be signed in to change notification settings - Fork 37
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
ActionCable url is not set correctly when using v3 on rail 7.2 #81
Comments
@iuri-gg Can you please share the "setup" code that connects to your ActionCable server? |
Sure, I am not using the composition API of vue 3 - still using the options API. I have the following code:
|
@iuri-gg Please share your |
if I uncomment
|
@iuri-gg The library requires you to set a |
is the readme out of date then? According to it |
@iuri-gg I just released 3.0.4. Please try that and let me know if the issue remains. |
still the same issue on |
@iuri-gg Please share a screenshot of the websocket URL in the dev console. |
@iuri-gg It looks like the URL is correct, but your batch ID isn't being set. Can you please share the code that creates that URL? |
No, URL is not correct. action cable URL does not change on different pages - it is always the same WebSocket URL. In production it is usually
|
As for the code. if I specify
|
I ran into a similar problem with Rails 7.1, so I don't think the problem is related to Rails 7.2. What fixed it for me was to change the environment variable that contains the connection string (in my case Since this is a behavior of Vite and not Rails/ActionCable and there was a recent Vite commit that changed EDIT Turns out this only fixed it on localhost (using const connectionUrl = `ws${['development', 'test'].includes(import.meta.env.MODE) ? '' : 's'}://${window.location.host}/cable This works due to how the app in question is set up. |
For v3.x, I didn't change anything other than updating to the latest version of |
Describe the bug
url for websocket connection defaults to
null
when using v3 version of the package with vue 3 and rail 7.2. v2 of the package was working withuid
patch.Temporary fix is to import
ActionCable
in js and initializeActionCableVue
withconnectionUrl: ActionCable.getConfig("url")
To Reproduce
Steps to reproduce the behaviour:
null
Expected behaviour
It should be using ws url from ActionCable
Plugin version (please complete the following information):
The text was updated successfully, but these errors were encountered: