Problem Solving — JS Undefined Error Fix

Praba Prakash
2 min readMay 7, 2019

--

I was part of fantastic core team. We built a Critical Mortgage Workflow Product in short period.

We getting Mortgage information from third party loan origination service provider and processing faster in our services to make Underwriting work quicker.

We’re using React/Node/Docker DC/Dot Net Core/Scala Play as our tech stack.

We’re facing serious issue with undefined values, even though we covered 75 percent of test cases in source code.

Too much escalation, even our code push blocked for while.

After a week of thinking “how to resolve it”, I come up simple solution, I read all utility files in single shot and run all method dynamically with undefined method param values.

I logged all exception, it will be around 100 exceptions. We started fixing it. We used lodash library, _.get function.

oops, it makes product stable.

Below is following script,

The above script loop through all utility files one by one, getting the list of functions and it’s metadata, after then it executing the functions with all undefined params.

We logged all exceptions occurred in every files getting their filename and function name and we fixed one by one.

Now, The product is so stable. We eradicated the undefined errors up to 90%. The problem is big, but we fixed on time by thinking out of box

--

--