Skip to content
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

wslink is not expecting text message #26

Closed
jonasfoerster opened this issue Aug 26, 2024 · 8 comments
Closed

wslink is not expecting text message #26

jonasfoerster opened this issue Aug 26, 2024 · 8 comments

Comments

@jonasfoerster
Copy link

jonasfoerster commented Aug 26, 2024

I tried to run the server client example (https://github.com/Kitware/trame-server/tree/master/examples/client-server). I started the server as described. If I start the client, I see this message in the server console window:

wslink is not expecting text message:
> {"wslink": "1.0", "id": "system:c0:0", "method": "wslink.hello", "args": [{"secret": "wslink-secret"}], "kwargs": {}}
wslink is not expecting text message:
> {"wslink": "1.0", "id": "rpc:None:1", "method": "trame.state.update", "args": [[{"key": "counter", "value": 0}]], "kwargs": {}}

If I click on the '+'-button on the client page, the counter on the server page is not synchronized. I get this message in server console window:

wslink is not expecting text message:
> {"wslink": "1.0", "id": "rpc:None:2", "method": "trame.state.update", "args": [[{"key": "counter", "value": 1}]], "kwargs": {}}

Tested on Windows 11, Python 3.11.5 with

aiohappyeyeballs==2.4.0
aiohttp==3.10.5
aiosignal==1.3.1
attrs==24.2.0
certifi==2024.7.4
charset-normalizer==3.3.2
contourpy==1.2.1
cycler==0.12.1
fonttools==4.53.1
frozenlist==1.4.1
idna==3.8
kiwisolver==1.4.5
matplotlib==3.9.2
more-itertools==10.4.0
msgpack==1.0.8
multidict==6.0.5
numpy==2.1.0
packaging==24.1
pillow==10.4.0
platformdirs==4.2.2
pooch==1.8.2
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pyvista==0.44.1
requests==2.32.3
scooby==0.10.0
six==1.16.0
trame==3.6.3
trame-client==3.2.5
trame-server==3.1.0
trame-vtk==2.8.10
trame-vuetify==2.6.2
typing_extensions==4.12.2
urllib3==2.2.2
vtk==9.3.1
wslink==2.1.2
yarl==1.9.4
@Kitware Kitware deleted a comment Aug 26, 2024
@jourdain
Copy link
Collaborator

jourdain commented Aug 26, 2024

Your trame client and trame server are incompatible. Please update them or make them match. Also make sure you clear your browser cache to prevent old JS code to be used with new server.

pip install trame -U

or

pip install trame-server trame-client -U

@jonasfoerster
Copy link
Author

jonasfoerster commented Aug 27, 2024

If I update trame, trame-server and trame-client, I still have these versions, which seem to be latest versions published:

trame==3.6.3
trame-client==3.2.5
trame-server==3.1.0

I tried to downgrade trame-client to 3.1.0 via pip install trame-client==3.1 but I still see the same messages.

Which versions are compatible to each other?

@jourdain
Copy link
Collaborator

Those versions are compatibles, your issue is your browser caching trame-client<3

Otherwise:

  • trame-client=2.* compatible with tame-server=2.*
  • trame-client=3.* compatible with tame-server=3.*

@jourdain
Copy link
Collaborator

Actually I've seen virtual environment manager (like uv) messing things up with their caching logic.
Try rebuilding your environment from scratch and without cache.

@Fevola
Copy link

Fevola commented Sep 3, 2024

Hello, I have encountered the same issue using the same example.
My versions are as follows:

trame = 3.6.3
trame-client = 3.2.5
trame-server = 3.1.0

I've got failure results on both Windows 10 and Windows 11 systems, using both Edge and Chrome browsers.
In another response, I saw that the issue could be resolved by using different ports and clearing the cache. In this example, the port of server is 1234 and the port of client is 1235, so there should be no port conflict. I have tried clearing the cache, but it did not work.

@ruihuasun
Copy link

Those versions are compatibles, your issue is your browser caching trame-client<3

Otherwise:

  • trame-client=2.* compatible with tame-server=2.*
  • trame-client=3.* compatible with tame-server=3.*

Same thing happens to me too. I just download the code zip and run this example. "wslink is not expecting text message:" is showing.
I'm pretty sure that all the package versions are up to date. I have no idea how to debug this problem.

Besides, I think as a web framework, if the official examples can't work, it's hard to make it "the core of your next web application", and hard to make us be a contributor.

@jourdain
Copy link
Collaborator

jourdain commented Sep 3, 2024

Looking into it now make me realized that the issue is not from the JS side but from Python. That code has not been updated to use our msgpack encoding. To temporary fix, you can use trame<3.6.

Sorry about that and I'm looking at fixing that code right now.

@jourdain
Copy link
Collaborator

jourdain commented Sep 3, 2024

Should be fixed now with trame>=3.6 and trame-server>=3.1.1.

@jourdain jourdain closed this as completed Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants
@jourdain @ruihuasun @jonasfoerster @Fevola and others