Anvil Community Forum

[DONE] Print a warning for undefined component events

When I define an event for a component, I set the event name in the component properties and I create a function with the same name in the form.

Later I either don’t need that event anymore and delete the function or decide to change its name, but I only change the function name in the form, not in the component properties (or viceversa). In both cases I end up with a component with an event set to execute a function that does not exist. And I don’t like it.

I would like one of the following:

  • The IDE to print in the output panel the list of events defined in the components that don’t match any form member when the app starts. This would only affect the debugging session
  • The IDE to print a warning in the output panel when an event that doesn’t have a matching form member is fired. This would only affect the debugging session as well
  • The app to throw an exception when an event that doesn’t have a matching form member is fired. This would prevent apps with sloppy event settings from running

I vote for the 3rd option, I don’t see why a developer should be forgiven for being sloppy, but any of the above solutions would help me keeping things under control.

1 Like

I just saw this:
image

They do listen to us!!
:heart:

5 Likes