Skip to content

App doesnt render anything - no error in console #5227

@phifuh

Description

@phifuh

First Check

  • I added a very descriptive title here.
  • This is not a Q&A. I am sure something is wrong with NiceGUI or its documentation.
  • I used the GitHub search to find a similar issue and came up empty.

Example Code

@property
    def allow_export(self) -> bool:
        """Get the allow_export state."""
        return self._allow_export

    @allow_export.setter
    def allow_export(self, value: bool) -> None:
        """Set the allow_export state."""
        self._allow_export = value
        if self.on_change_callback:
            self.on_change_callback("is_exportable", value)


export_switch = ui.switch(value=self.allow_export)
export_switch.on_value_change(lambda e: setattr(self, "allow_export", e.value))

Description

Today happend a very strange glitch. I was working on changing some classes/props and while hot reloading still was working, when swapping to the debug session nicegui didnt load anymore. After that i swapped back to a normal instance and the instance neither was working anymore. So I looked at .git to identify the current changes and I knew that only the switch lambda function could be the cause of this bug. So I commented the line and the app started again. Once I uncommented the line the app was again working as expected, which makes me believe that there is something funky going on behind the scenes which i cant explain.

What happens is that nicegui simply is stuck in loading. Even tho the terminal prints "NiceGUI ready to go on.." if u open it up the website is empty.

I had this bug 2-3 times in the last 2 month so its not happning frequently but I have no clue what it is. I expect it has something to do with either invoking inline functions or a issue when using wrong props/syntax.

I know that this glitch/bug was super frustratring the first time I had this issue a few backs because I simply couldnt explain it and its hard to reproduce and commenting/uncommenting the lambda function fixed it.

NiceGUI Version

2.21

Python Version

3.13.1

Browser

Chrome

Operating System

Windows

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionStatus: Needs clarification from the author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions