Skip to content

Uncaught JS Error : Passing a var instead of event handler to an event_trigger  #310

@Lendemor

Description

@Lendemor

Describe the bug
When you pass the wrong kind of argument to an event trigger (var instead of event handler), it result in a runtime JS error instead of compilation python error.

To Reproduce
Steps to reproduce the behavior:

class State(pc.State):
    some_var: bool

def index():
    return pc.box(pc.icon(tag="AddIcon", on_click=State.some_var))

Expected behavior
Compilation should catch this error and throw a Python traceback to identify the problem

Screenshots
image

** Specifics (please complete the following information):**

  • Python Version: 3.10
  • Pynecone Version: 0.1.13
  • OS: Ubuntu 22.04
  • Browser (Optional): Chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions