Why is Kony Visualizer Enterprise 8.4 not finding my JavaScript methods?

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I have recently updated to Kony Visualizer Enterprise 8.4 and run into several problems.

One of them is that a defined method isn't found any more. How could that be? What has changed this time?

—————

Update 1:

The function is defined in a file called Master.js and to ease locating loading problems I begin and end all modules with with two log statement like this:

kony.print("+ Master"); … kony.print("- Master");

Now, the logs don't show up when starting the app. This reminds me a problem I had previous. Let me check.

-----

Update 2:

The logs are back and the functions work again:

02-20 12:37:08.139 10816 10901 D StandardLib: + Main… 02-20 12:37:08.139 10816 10901 D StandardLib: 02-20 12:37:08.139 10816 10901 D StandardLib: - Main… 02-20 12:37:08.139 10816 10901 D StandardLib: 02-20 12:37:08.149 10816 10901 D StandardLib: + Master 02-20 12:37:08.149 10816 10901 D StandardLib: 02-20 12:37:08.149 10816 10901 D StandardLib: - Master 02-20 12:37:08.149 10816 10901 D StandardLib: 02-20 12:37:08.155 10816 10901 D StandardLib: + Messaging 02-20 12:37:08.155 10816 10901 D StandardLib: 02-20 12:37:08.155 10816 10901 D StandardLib: - Messaging 02-20 12:37:08.155 10816 10901 D StandardLib: 02

But why? I haven't change anything! And unreliable build system gives me really bad feelings.

—————

Update 3:

Debugging further I found another missing function.

Of course the function isn't really missing. It's there but Visualizer won't find it.

@John Tuwnew​ FYI

@Dvvnish Rosv​ @Rexeccv Wilson​ FYI.

@Onuw Gwegowy​ There could be possible syntax errors within the modules(this is a guess as the source isn't shared). Visualizer does syntax validations before each build and logs them to Visualizer logs. so, please attach Visualizer logs if possible.

@Rexeccv Wilson​

I addressed syntax errors in «Update 1» — those kony.prints are specially added to detect syntax errors. When there was a syntax error I would get the “+” log but not the “-" log. Not to mention that Master.js is actually written in typescript and any syntax error would be caught by the typescript compiler.

Also it's a migrated project. Everything worked fine on with W8 SP3 and no changes to the JavaScript files have been made. So unless you changed the javascript engine there should be no problem.

Lastly: for reasons unknown the Master.js was eventually picked up and then worked fine. Now there is at least one more JS-file missing from the app.

No, i can rule out syntax errors with confidence. There is something else.

@Onuw Gwegowy​

Can you click on the action where function is missing, and see if "Loading.." is being shown at the bottom half (instead of function name) ?

No, it wasn't. It just says “function not found” and when I click on it the name disappears:**Image removed for security reasons**

But as I said: The function is there, I can open the file in the editor just fine:

**Image removed for security reasons**

But it's not in the list of function to choose from.

With the following steps was able to fix it:

  1. rename the JavaScript file
  2. refresh Visualizer
  3. rename the JavaScript file back to the original name
  4. refresh Visualizer

This is of course not a good solution. Visualizer should recognise JavaScript files without jumping through hoops.

Problem is back again. This is the worse case scenario: A bug which comes and goes.

Please check if we have any out of memory errors in Visualizer logs.

In a simple freeform setup your scenario is working fine,

  • Have a module - Master.js with a function mainButtonPressed()
  • Have form with a button whose onClick is mapped to invokeFunction of mainButtonPressed
  • Save all and do Live Preview - working fine
  • Update Master.js with a syntax error - Build completed, Live Preview failed
  • Fix syntax error Master,js - Build completed and button action is working fine in Live preview.

Obviously yours is a bigger project, so please suggest any variation to this scenario, to get a repo of issue.

OK, I “fixed” it by replacing the function call with a code snippet.

That too isn't a good solution as I not have to hope I won't have any more buggy function calls.

Actually not fixed at all. It seems that the whole build system is broken and changes in then JS code are not carried into the final app. I just added a few logs to my file (and changed existing logs for good measure) but the log output doesn't change at all.

What a pain.