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

In Express mode, an AttributeError during tagify() results in unhelpful error #937

Closed
wch opened this issue Dec 22, 2023 · 1 comment · Fixed by #941
Closed

In Express mode, an AttributeError during tagify() results in unhelpful error #937

wch opened this issue Dec 22, 2023 · 1 comment · Fixed by #941
Labels
Milestone

Comments

@wch
Copy link
Collaborator

wch commented Dec 22, 2023

Example:

from shiny.express import input, ui

with ui.nav_panel(title="One"):
    "one"

with ui.sidebar():
    "hello"

Results in this error:

ERROR:    Error loading ASGI app. Attribute "_2f_Users_2f_winston_2f_Projects_2f_py_2d_shiny_2f_examples_2f_express_2f_sidebar_5f_app_2e_py" not found in module "shiny.express.app".
@wch wch added this to the v0.7.0 milestone Dec 22, 2023
@wch wch added the express label Dec 22, 2023
@wch
Copy link
Collaborator Author

wch commented Dec 23, 2023

This error happens when an AttributeError is raised when a tagify() method is called on an object in the UI, and Uvicorn specifically looks for AttributeErrors and prints a customized error message.

It's very similar to #869, except that in that case, the AttributeError was raised during the initial evaluation of the code, whereas in this case, the AttributeError is raised later, when tagify() is called.

The running of tagify() happens here:

rendered = HTMLDocument(ui_res).render(lib_prefix=lib_prefix)

@wch wch changed the title In Express mode, a nav_panel and sidebar results in confusing error In Express mode, an AttributeError during tagify() results in unhelpful error Dec 23, 2023
@wch wch closed this as completed in #941 Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant