Trying to identify a data binding error

I have an app that has been running fine for more than a year. It is now suddenly giving a data binding error

SyntaxError: Syntax error in data binding for self.label_1.text

This happens right from the Startup Form, so am unable to locate where the error lies. In fact, it doesn’t even allow the Startup Form to load to view the login button

I have tried tracing out every single Self.Label1 element in my forms manually, but not finding any issue. Is there a better way to diagnose this error?

BTW, even if i create a new form and make it the Startup Form, I get the same error. can this be a bug on the anvil side?

Hi @ananth,

What a frustrating hunt! As always with Python, a syntax error can prevent anything loading at all, but it’s awkward to have no indication of where the problem is. We’ve now deployed an update that identifies which form contains the offending binding, so you can at least fix it!

2 Likes

Saw the update and rectified the app. Crisis averted. Thank you for the lightning-fast help!!!

One question remains - even if there is an error on one page, it should not technically block any other page from loading, esp. when set as a startup form. Any reason why this may happen?

1 Like

The reason here is that data bindings are baked into the FormTemplate classes, and these are all imported at start time as part of booting your application. Therefore, an error parsing those will cause the whole application boot process to bail out.

It’s the same thing as making a syntax error in a common package that is imported by all of your code - even if you’re not using that functionality yet, it can prevent your app from loading!