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

~Better~ Any error message for input/output and server/ui module names misalignment. #1304

Open
pstorozenko opened this issue Apr 11, 2024 · 0 comments

Comments

@pstorozenko
Copy link

Hi,
right now shiny gives no python error message (there's something in the js console) when running code:

  1. With ui module, but without server
  2. With server module, but without ui
  3. With duplicated server/ui modules

This is probably connected to much more important issue of no error when there's input/output names misalignment (let's say we have text_out in line 8 and txt_out in line 16, we have no error and no place to start debugging from).

Even if not at static time (cause some inputs might come from js code for example), it would be great to have clear error "server"/"module" defined without "module"/"server" or even "Input foo from ui bar not found." / "Server foo doesn't have recipe for rendering bar text output" at runtime.

Have you considered it? Is it possible, do you plan to introduce it?


Example from docs I played with.

from shiny import App, Inputs, Outputs, Session, module, render, ui

@module.ui
def row_ui():
    return ui.row(
        ui.column(6, ui.input_text("text_in", "Enter text")),
        ui.column(6, ui.output_text("text_out")),
    )

@module.server
def row_server(input: Inputs, output: Outputs, session: Session):
    @output
    @render.text
    def text_out():   # Change to txt_out
        return f"You entered {input.text_in()}"

app_ui = ui.page_fluid(
    row_ui("row_1"),  # comment / uncomment
    # row_ui("row_1"),  # comment / uncomment
)

def server(input: Inputs, output: Outputs, session: Session):
    row_server("row_1")  # comment / uncomment
    pass

app = App(app_ui, server)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant