examples
examples copied to clipboard
运行trolli出现'NoneType' object has no attribute 'width'错误
我安装以下步骤运行,然后收到'NoneType' object has no attribute 'width'异常
git clone https://github.com/flet-dev/examples.git
cd examples\python\apps\trolli
pip3 install -r requirements.txt
python3 ./src/main.py
Unhandled error processing page session : Traceback (most recent call last):
File "D:\Procedure\LanguageInterpreter\Python310\lib\site-packages\flet_runtime\app.py", line 363, in on_session_created
session_handler(page)
File "E:\SourceCode\gitlab\examples\python\apps\trolli\src\main.py", line 207, in main
app.initialize()
File "E:\SourceCode\gitlab\examples\python\apps\trolli\src\main.py", line 86, in initialize
self.create_new_board("My First Board")
File "E:\SourceCode\gitlab\examples\python\apps\trolli\src\main.py", line 187, in create_new_board
new_board = Board(self, self.store, board_name)
File "E:\SourceCode\gitlab\examples\python\apps\trolli\src\board.py", line 49, in __init__
width=(self.app.page.width - 310),
AttributeError: 'NoneType' object has no attribute 'width'
经过分析发现在src\main.py:83 self.page.update()
后self.page就会等于None
跟踪下去是flet_core\page.py:466 ctrl.page = None
将其赋值为None
请问是什么问题导致的呢,以下是我的版本
Python 3.10.7 flet 0.12.0 flet-core 0.12.0 flet-fastapi 0.12.0 flet-runtime 0.12.0
我将flet_core\page.py:466 ctrl.page = None
改为 if ctrl.page != self: ctrl.page = None
就不出现这个异常了,我不了解为啥需要设置为None
I installed flet==0.3.2 which temporarily solved the issue. What might be the cause ? Trelloi needs to get updated
Trelloi needs to get updated.
That's right.
@FeodorFitsner Are you guys not planning to fix this? I'm blocked because of this. was planning to propose flet for development to my org but now I can't.
@sumitkanoje you mean fixing Trolli app?
@FeodorFitsner not the Trolli app but the issue that causes this error in Trolli app? or let me know any way to fix this without downgrading the app?
As mentioned by @get-Resource flet_core\page.py:466 ctrl.page = None
should be replaced with if ctrl.page != self: ctrl.page = None
In same issue Here link wich help me https://github.com/flet-dev/examples/issues/104#issuecomment-1851756942