Hi guys. As the application grows larger it’s becoming increasingly difficult to debug javascript functions. Today I got this error message: “Error running function: undefined is not an object (evaluating ‘string.match’)”. There are a few details that you can look upon but it seems that that does not give any definitive pointer to where the bug is. Currently I am unable to find the snippet causing the problem without looking through everything in this view to see where string.match is used. I might be missing something, but it feels like it should be a more conclusive reference to the problem in the code in the debug section of the APP.
Any suggestions on how to improve the situation?
Its not really about the debugging of the code itself, its more about finding where the code sits as there doesn’t seem to be any clear indication about that in the details.
You can try to narrow down the search by going to https://create.appfarm.io/SOLUTION-NAME/apps/APP-ID/data/dataSourceId/propertyId
Where dataSourceId is “4r6Qhe” and propertyId is “8Ko3Do”. This will lead you to the property used in the function, and then you can use “Find References” on the property to find the relevant functions.
I will also register a ticket with the platform team to improve the debugging of functions, it should be easier than this
There is no way to use the functionName to URL your way into the right place in Create, but you should be able to go to https://SOLUTIONNAME-dev.appfarm.app/api/v1/apps/APP-ID/metadata/function to find a list of all functions in your app, listed by functionName.