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

flet==0.25.0.dev3721 hot reload not working flet run main.py -d -r #4380

Open
1 task done
jtoror opened this issue Nov 16, 2024 · 6 comments
Open
1 task done

flet==0.25.0.dev3721 hot reload not working flet run main.py -d -r #4380

jtoror opened this issue Nov 16, 2024 · 6 comments

Comments

@jtoror
Copy link

jtoror commented Nov 16, 2024

Duplicate Check

Describe the bug

hot reload not working flet run main.py -d -r

Code sample

Code
[Paste your code here]

To reproduce

flet run main.py -d -r

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Linux

Operating system details

Kubuntu 24.04

Flet version

0.25.0.dev3721

Regression

No, it isn't

Suggestions

No response

Logs

Logs
.venvdev@dev-p:~/dev_code/linux/flet/gym_sa$ flet run main.py -r
--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1164, in emit
    self.flush()
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1144, in flush
    self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='/home/dev/dev_code/linux/flet/gym_sa/log/main.log'>
Call stack:
  File "/home/dev/dev_code/linux/flet/gym_sa/main.py", line 158, in <module>
    ft.app(target=main, assets_dir="assets")
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 64, in app
    return asyncio.run(
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1986, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 150, in app_async
    await __run_socket_server(
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 258, in __run_socket_server
    conn = FletSocketServer(
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/flet_socket_server.py", line 40, in __init__
    super().__init__()
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/local_connection.py", line 12, in __init__
    super().__init__()
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/connection.py", line 12, in __init__
    self.pubsubhub = PubSubHub()
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/pubsub/pubsub_hub.py", line 20, in __init__
    logger.debug("Creating new PubSubHub instance")
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1527, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1762, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1028, in handle
    self.emit(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1280, in emit
    StreamHandler.emit(self, record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1164, in emit
    self.flush()
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1144, in flush
    self.stream.flush()
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 141, in exit_gracefully
    logger.debug("Gracefully terminating Flet app...")
Message: 'Gracefully terminating Flet app...'
Arguments: ()
Gtk-Message: 15:56:28.323: Failed to load module "colorreload-gtk-module"
Gtk-Message: 15:56:28.324: Failed to load module "window-decorations-gtk-module"
package:media_kit_libs_linux registered.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Stack Overflow
#0      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#1      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#2      main.<anonymous closure> (package:flet_client/main.dart)
#3      FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#4      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#5      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#6      main.<anonymous closure> (package:flet_client/main.dart)
#7      FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#8      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#9      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#10     main.<anonymous closure> (package:flet_client/main.dart)
#11     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#12     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#13     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#14     main.<anonymous closure> (package:flet_client/main.dart)
#15     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#16     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#17     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#18     main.<anonymous closure> (package:flet_client/main.dart)
#19     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#20     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#21     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#22     main.<anonymous closure> (package:flet_client/main.dart)
#23     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#24     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#25     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#26     main.<anonymous closure> (package:flet_client/main.dart)
#27     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#28     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#29     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#30     main.<anonymous closure> (package:flet_client/main.dart)
#31     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#32     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#33     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#34     main.<anonymous closure> (package:flet_client/main.dart)
#35     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#36     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#37     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#38     main.<anonymous closure> (package:flet_client/main.dart)
#39     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#40     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#41     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#42     main.<anonymous closure> (package:flet_client/main.dart)
#43     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
...
...
#23081  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23082  main.<anonymous closure> (package:flet_client/main.dart)
#23083  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23084  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23085  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23086  main.<anonymous closure> (package:flet_client/main.dart)
#23087  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23088  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23089  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23090  main.<anonymous closure> (package:flet_client/main.dart)
#23091  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23092  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23093  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23094  main.<anonymous closure> (package:flet_client/main.dart)
#23095  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23096  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23097  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23098  main.<anonymous closure> (package:flet_client/main.dart)
#23099  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23100  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23101  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23102  main.<anonymous closure> (package:flet_client/main.dart)
#23103  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23104  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23105  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23106  main.<anonymous closure> (package:flet_client/main.dart)
#23107  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23108  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23109  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23110  main.<anonymous closure> (package:flet_client/main.dart)
#23111  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23112  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23113  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23114  main.<anonymous closure> (package:flet_client/main.dart)
#23115  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23116  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23117  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23118  main.<anonymous closure> (package:flet_client/main.dart)
#23119  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23120  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23121  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23122  main.<anonymous closure> (package:flet_client/main.dart)
#23123  PlatformDispatcher._dispatchError (dart:ui/platform_dispatcher.dart)
#23124  _onError (dart:ui/hooks.dart)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Stack Overflow
#0      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#1      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#2      main.<anonymous closure> (package:flet_client/main.dart)
#3      FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#4      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#5      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#6      main.<anonymous closure> (package:flet_client/main.dart)
#7      FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#8      ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#9      FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#10     main.<anonymous closure> (package:flet_client/main.dart)
#11     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#12     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#13     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#14     main.<anonymous closure> (package:flet_client/main.dart)
#15     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#16     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#17     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#18     main.<anonymous closure> (package:flet_client/main.dart)
#19     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#20     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#21     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#22     main.<anonymous closure> (package:flet_client/main.dart)
#23     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#24     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#25     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#26     main.<anonymous closure> (package:flet_client/main.dart)
#27     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#28     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#29     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#30     main.<anonymous closure> (package:flet_client/main.dart)
#31     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#32     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#33     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#34     main.<anonymous closure> (package:flet_client/main.dart)
#35     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#36     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#37     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#38     main.<anonymous closure> (package:flet_client/main.dart)
#39     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#40     ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#41     FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#42     main.<anonymous closure> (package:flet_client/main.dart)
#43     FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
...
...
#23081  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23082  main.<anonymous closure> (package:flet_client/main.dart)
#23083  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23084  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23085  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23086  main.<anonymous closure> (package:flet_client/main.dart)
#23087  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23088  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23089  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23090  main.<anonymous closure> (package:flet_client/main.dart)
#23091  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23092  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23093  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23094  main.<anonymous closure> (package:flet_client/main.dart)
#23095  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23096  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23097  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23098  main.<anonymous closure> (package:flet_client/main.dart)
#23099  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23100  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23101  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23102  main.<anonymous closure> (package:flet_client/main.dart)
#23103  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23104  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23105  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23106  main.<anonymous closure> (package:flet_client/main.dart)
#23107  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23108  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23109  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23110  main.<anonymous closure> (package:flet_client/main.dart)
#23111  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23112  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23113  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23114  main.<anonymous closure> (package:flet_client/main.dart)
#23115  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23116  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23117  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23118  main.<anonymous closure> (package:flet_client/main.dart)
#23119  FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23120  ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23121  FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23122  main.<anonymous closure> (package:flet_client/main.dart)
#23123  PlatformDispatcher._dispatchError (dart:ui/platform_dispatcher.dart)
#23124  _onError (dart:ui/hooks.dart)

--- Logging error ---
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1164, in emit
    self.flush()
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1144, in flush
    self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='/home/dev/dev_code/linux/flet/gym_sa/log/main.log'>
Call stack:
  File "/home/dev/dev_code/linux/flet/gym_sa/main.py", line 158, in <module>
    ft.app(target=main, assets_dir="assets")
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 64, in app
    return asyncio.run(
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
    return runner.run(main)
  File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1986, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/flet_socket_server.py", line 88, in handle_connection
    logger.debug("Connected new TCP client")
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1527, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1684, in _log
    self.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1700, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1762, in callHandlers
    hdlr.handle(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1028, in handle
    self.emit(record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1280, in emit
    StreamHandler.emit(self, record)
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1164, in emit
    self.flush()
  File "/usr/local/lib/python3.12/logging/__init__.py", line 1144, in flush
    self.stream.flush()
  File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 141, in exit_gracefully
    logger.debug("Gracefully terminating Flet app...")
Message: 'Gracefully terminating Flet app...'
Arguments: ()

Additional details

No response

@tanmay-bhatgare
Copy link

reinstall flet==0.25.0.dev3721 and then run flet run main.py -r worked for me.

@jtoror
Copy link
Author

jtoror commented Nov 17, 2024

reinstall flet==0.25.0.dev3721 and then run flet run main.py -r worked for me.

I've already tried it with a clean install and it doesn't work with -d -r on recursive directories, it only works with files in the main directory.

image

.venvdev@dev-p:~/dev_code/linux/flet/gym_sa$ flet run main.py -r
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.12/logging/init.py", line 1164, in emit
self.flush()
File "/usr/local/lib/python3.12/logging/init.py", line 1144, in flush
self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='/home/dev/dev_code/linux/flet/gym_sa/log/main.log'>
Call stack:
File "/home/dev/dev_code/linux/flet/gym_sa/main.py", line 158, in
ft.app(target=main, assets_dir="assets")
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 64, in app
return asyncio.run(
File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1986, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 150, in app_async
await __run_socket_server(
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 258, in __run_socket_server
conn = FletSocketServer(
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/flet_socket_server.py", line 40, in init
super().init()
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/local_connection.py", line 12, in init
super().init()
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/connection.py", line 12, in init
self.pubsubhub = PubSubHub()
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/core/pubsub/pubsub_hub.py", line 20, in init
logger.debug("Creating new PubSubHub instance")
File "/usr/local/lib/python3.12/logging/init.py", line 1527, in debug
self._log(DEBUG, msg, args, **kwargs)
File "/usr/local/lib/python3.12/logging/init.py", line 1684, in _log
self.handle(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1700, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1762, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1028, in handle
self.emit(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1280, in emit
StreamHandler.emit(self, record)
File "/usr/local/lib/python3.12/logging/init.py", line 1164, in emit
self.flush()
File "/usr/local/lib/python3.12/logging/init.py", line 1144, in flush
self.stream.flush()
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 141, in exit_gracefully
logger.debug("Gracefully terminating Flet app...")
Message: 'Gracefully terminating Flet app...'
Arguments: ()
Gtk-Message: 15:56:28.323: Failed to load module "colorreload-gtk-module"
Gtk-Message: 15:56:28.324: Failed to load module "window-decorations-gtk-module"
package:media_kit_libs_linux registered.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Stack Overflow
#0 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#1 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#2 main. (package:flet_client/main.dart)
#3 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#4 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#5 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#6 main. (package:flet_client/main.dart)
#7 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#8 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#9 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#10 main. (package:flet_client/main.dart)
#11 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#12 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#13 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#14 main. (package:flet_client/main.dart)
#15 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#16 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#17 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#18 main. (package:flet_client/main.dart)
#19 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#20 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#21 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#22 main. (package:flet_client/main.dart)
#23 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#24 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#25 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#26 main. (package:flet_client/main.dart)
#27 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#28 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#29 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#30 main. (package:flet_client/main.dart)
#31 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#32 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#33 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#34 main. (package:flet_client/main.dart)
#35 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#36 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#37 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#38 main. (package:flet_client/main.dart)
#39 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#40 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#41 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#42 main. (package:flet_client/main.dart)
#43 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
...
...
#23081 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23082 main. (package:flet_client/main.dart)
#23083 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23084 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23085 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23086 main. (package:flet_client/main.dart)
#23087 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23088 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23089 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23090 main. (package:flet_client/main.dart)
#23091 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23092 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23093 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23094 main. (package:flet_client/main.dart)
#23095 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23096 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23097 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23098 main. (package:flet_client/main.dart)
#23099 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23100 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23101 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23102 main. (package:flet_client/main.dart)
#23103 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23104 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23105 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23106 main. (package:flet_client/main.dart)
#23107 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23108 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23109 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23110 main. (package:flet_client/main.dart)
#23111 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23112 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23113 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23114 main. (package:flet_client/main.dart)
#23115 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23116 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23117 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23118 main. (package:flet_client/main.dart)
#23119 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23120 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23121 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23122 main. (package:flet_client/main.dart)
#23123 PlatformDispatcher._dispatchError (dart:ui/platform_dispatcher.dart)
#23124 _onError (dart:ui/hooks.dart)

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Stack Overflow
#0 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#1 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#2 main. (package:flet_client/main.dart)
#3 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#4 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#5 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#6 main. (package:flet_client/main.dart)
#7 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#8 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#9 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#10 main. (package:flet_client/main.dart)
#11 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#12 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#13 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#14 main. (package:flet_client/main.dart)
#15 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#16 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#17 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#18 main. (package:flet_client/main.dart)
#19 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#20 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#21 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#22 main. (package:flet_client/main.dart)
#23 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#24 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#25 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#26 main. (package:flet_client/main.dart)
#27 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#28 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#29 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#30 main. (package:flet_client/main.dart)
#31 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#32 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#33 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#34 main. (package:flet_client/main.dart)
#35 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#36 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#37 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#38 main. (package:flet_client/main.dart)
#39 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#40 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#41 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#42 main. (package:flet_client/main.dart)
#43 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
...
...
#23081 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23082 main. (package:flet_client/main.dart)
#23083 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23084 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23085 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23086 main. (package:flet_client/main.dart)
#23087 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23088 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23089 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23090 main. (package:flet_client/main.dart)
#23091 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23092 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23093 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23094 main. (package:flet_client/main.dart)
#23095 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23096 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23097 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23098 main. (package:flet_client/main.dart)
#23099 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23100 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23101 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23102 main. (package:flet_client/main.dart)
#23103 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23104 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23105 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23106 main. (package:flet_client/main.dart)
#23107 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23108 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23109 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23110 main. (package:flet_client/main.dart)
#23111 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23112 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23113 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23114 main. (package:flet_client/main.dart)
#23115 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23116 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23117 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23118 main. (package:flet_client/main.dart)
#23119 FlutterError.reportError (package:flutter/src/foundation/assertions.dart)
#23120 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart)
#23121 FletAppErrorsHandler.onError (package:flet/src/flet_app_errors_handler.dart)
#23122 main. (package:flet_client/main.dart)
#23123 PlatformDispatcher._dispatchError (dart:ui/platform_dispatcher.dart)
#23124 _onError (dart:ui/hooks.dart)

--- Logging error ---
Traceback (most recent call last):
File "/usr/local/lib/python3.12/logging/init.py", line 1164, in emit
self.flush()
File "/usr/local/lib/python3.12/logging/init.py", line 1144, in flush
self.stream.flush()
RuntimeError: reentrant call inside <_io.BufferedWriter name='/home/dev/dev_code/linux/flet/gym_sa/log/main.log'>
Call stack:
File "/home/dev/dev_code/linux/flet/gym_sa/main.py", line 158, in
ft.app(target=main, assets_dir="assets")
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 64, in app
return asyncio.run(
File "/usr/local/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1986, in _run_once
handle._run()
File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/flet_socket_server.py", line 88, in handle_connection
logger.debug("Connected new TCP client")
File "/usr/local/lib/python3.12/logging/init.py", line 1527, in debug
self._log(DEBUG, msg, args, **kwargs)
File "/usr/local/lib/python3.12/logging/init.py", line 1684, in _log
self.handle(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1700, in handle
self.callHandlers(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1762, in callHandlers
hdlr.handle(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1028, in handle
self.emit(record)
File "/usr/local/lib/python3.12/logging/init.py", line 1280, in emit
StreamHandler.emit(self, record)
File "/usr/local/lib/python3.12/logging/init.py", line 1164, in emit
self.flush()
File "/usr/local/lib/python3.12/logging/init.py", line 1144, in flush
self.stream.flush()
File "/home/dev/dev_code/linux/flet/gym_sa/.venv/lib/python3.12/site-packages/flet/app.py", line 141, in exit_gracefully
logger.debug("Gracefully terminating Flet app...")
Message: 'Gracefully terminating Flet app...'
Arguments: ()

@tanmay-bhatgare
Copy link

which python version are you using and did this same happen with other flet stable versions? If no then flet-pre-release might have some flaws.
@ndonkoHenri

@jtoror
Copy link
Author

jtoror commented Nov 18, 2024

which python version are you using and did this same happen with other flet stable versions? If no then flet-pre-release might have some flaws. @ndonkoHenri

There have been issues with this for at least 2 stable versions of flet.

@tanmay-bhatgare
Copy link

which python version are you using and did this same happen with other flet stable versions? If no then flet-pre-release might have some flaws. @ndonkoHenri

There have been issues with this for at least 2 stable versions of flet.

There has to be something wrong with flet integration on some specific os. You should raise an issue regarding this as you said this same happens for stable versions too.

@molenaar
Copy link

molenaar commented Nov 27, 2024

I have these issues with stable version 0.24.1, and also with the 0.25.0.dev3721 version. flet run work fine, flet run -d or flet run -d -r or flet run -r keep hanging. Very anoying while developing.

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