# Debugging - finding the right function - JavaScript

**URL:** <https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809>\
**Category:** Ask the community\
**Tags:** ui, actions\
**Created:** [April 23, 2025, 3:10pm UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809 "2025-04-23T15:10:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oystein\_Selbekk](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oystein_selbekk/32/1677_2.png) [@Oystein\_Selbekk](https://community.appfarm.io/u/Oystein_Selbekk)\
**Post date:** [April 23, 2025, 3:10pm UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/1 "2025-04-23T15:10:21Z")

</div>

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?

Øystein

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 24, 2025, 6:30am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/2 "2025-04-24T06:30:32Z")

</div>

Hi!

Could you share the full error message that appears when you click “Show details” in dev tools? Like this:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/4/43ab1eeea86af7bdb5c8f731a8d1f1b9dd4f8d00.png)

---

<div class="post-metadata">

**Author:** ![Oystein\_Selbekk](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oystein_selbekk/32/1677_2.png) [@Oystein\_Selbekk](https://community.appfarm.io/u/Oystein_Selbekk)\
**Post date:** [April 24, 2025, 6:44am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/3 "2025-04-24T06:44:19Z")

</div>

Doesn’t fit all the details, but most of it:

 ![bug](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/b/b66e3dcdc3d0c7399c36f9026c2031a925fceaed.png)

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.

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 24, 2025, 7:05am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/4 "2025-04-24T07:05:05Z")

</div>

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 😅

---

<div class="post-metadata">

**Author:** ![Oystein\_Selbekk](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oystein_selbekk/32/1677_2.png) [@Oystein\_Selbekk](https://community.appfarm.io/u/Oystein_Selbekk)\
**Post date:** [April 24, 2025, 9:03am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/5 "2025-04-24T09:03:40Z")

</div>

Thank you for this and thank you for elevating this problem further. This gets me at least a bit closer 🙂  
Øystein

---

<div class="post-metadata">

**Author:** ![Oystein\_Selbekk](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oystein_selbekk/32/1677_2.png) [@Oystein\_Selbekk](https://community.appfarm.io/u/Oystein_Selbekk)\
**Post date:** [April 24, 2025, 9:05am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/6 "2025-04-24T09:05:08Z")

</div>

How about the “functionName”: “fn1bd626b8”… Is there a way to URL into that one?  
Øystein

---

<div class="post-metadata">

**Author:** ![Olav](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/olav/32/63_2.png) [@Olav](https://community.appfarm.io/u/Olav)\
**Post date:** [April 24, 2025, 11:05am UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/7 "2025-04-24T11:05:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ErikAKSkallevold](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/erikakskallevold/32/1378_2.png) [@ErikAKSkallevold](https://community.appfarm.io/u/ErikAKSkallevold)\
**Post date:** [April 24, 2025, 1:21pm UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/8 "2025-04-24T13:21:28Z")

</div>

You can see all your functions in the network log:

 ![bilde](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/3/32cb6f5b0f5ad99ec9079eeb23c648757026c3e9.png)

From there, you can search for the functionID that @Oystein_Selbekk posted.

 ![bilde](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/2X/c/cc8c8d007f24cd127007787afb37fc0a8fa716c1.png)

Sometimes I remember where a function is used by being able to see what it does.

// Erik

---

<div class="post-metadata">

**Author:** ![Oystein\_Selbekk](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/oystein_selbekk/32/1677_2.png) [@Oystein\_Selbekk](https://community.appfarm.io/u/Oystein_Selbekk)\
**Post date:** [April 24, 2025, 2:18pm UTC](https://community.appfarm.io/t/debugging-finding-the-right-function-javascript/1809/9 "2025-04-24T14:18:27Z")

</div>

Thank you for this. I will test this also 🙂  
Øystein
