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

运行trolli出现'NoneType' object has no attribute 'width'错误 #102

Open
get-Resource opened this issue Nov 13, 2023 · 7 comments
Open

Comments

@get-Resource
Copy link

我安装以下步骤运行,然后收到'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

@get-Resource
Copy link
Author

get-Resource commented Nov 13, 2023

我将flet_core\page.py:466 ctrl.page = None 改为 if ctrl.page != self: ctrl.page = None 就不出现这个异常了,我不了解为啥需要设置为None

@FeodorFitsner FeodorFitsner transferred this issue from flet-dev/flet Nov 13, 2023
@Pranzal360
Copy link

I installed flet==0.3.2 which temporarily solved the issue. What might be the cause ? Trelloi needs to get updated

@FeodorFitsner
Copy link
Contributor

Trelloi needs to get updated.

That's right.

@sumitkanoje
Copy link

@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.

@FeodorFitsner
Copy link
Contributor

@sumitkanoje you mean fixing Trolli app?

@sumitkanoje
Copy link

@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

@MusienkoAnton
Copy link

In same issue
Here link wich help me
#104 (comment)

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

5 participants