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

Textual command dev mode for live editing throws error about websocket. #3003

Closed
gallen opened this issue Jul 24, 2023 · 5 comments
Closed

Comments

@gallen
Copy link

gallen commented Jul 24, 2023

This is the first time I tried dev mode. Got this exception error,
textual run --dev app.py Traceback (most recent call last): File "/Users/liulyan/workspace/op/ARM/TESetMonitor/app.py", line 26, in <module> app.run() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/textual/app.py", line 1210, in run asyncio.run(run_app()) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/textual/app.py", line 1199, in run_app await self.run_async( File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/textual/app.py", line 1161, in run_async await app._process_messages( File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/textual/app.py", line 1872, in _process_messages await self.devtools.connect() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/textual_dev/client.py", line 116, in connect self.websocket = await self.session.ws_connect( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 779, in _ws_connect resp = await self.request( ^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client.py", line 560, in _request await resp.start(conn) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 899, in start message, payload = await protocol.read() # type: ignore[union-attr] ^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/aiohttp/streams.py", line 616, in read await self._waiter aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected

Here is the output for textual diagnose,
`# Textual Diagnostics

Versions

Name Value
Textual 0.30.0
Rich 13.3.3

Python

Name Value
Version 3.11.1
Implementation CPython
Compiler Clang 13.0.0 (clang-1300.0.29.30)
Executable /Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11

Operating System

Name Value
System Darwin
Release 22.4.0
Version Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64

Terminal

Name Value
Terminal Application iTerm.app (3.4.19)
TERM xterm-256color
COLORTERM truecolor
FORCE_COLOR Not set
NO_COLOR Not set

Rich Console options

Name Value
size width=202, height=29
legacy_windows False
min_width 1
max_width 202
is_terminal True
encoding utf-8
max_height 29
justify None
overflow None
no_wrap False
highlight None
markup None
height None
`
@github-actions
Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor

TomJGooding commented Jul 24, 2023

I've just tested this in a fresh virtual environment with textual and textual-dev and running textual run --dev seems to work fine.

Could you try creating a virtual environment and see if you get the same error?

@TomJGooding
Copy link
Contributor

Did you manage to get this working @gallen?

@willmcgugan
Copy link
Collaborator

Assuming this is fixed. Please reopen if it is still an issue.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

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

3 participants