March 9, 2011

Debugging tip:Error while executing JavaScript action expression

Occationally we stumble upon some "weird" errors on our xpages. Below is one such error:

Runtime Error

Error source

Page Name:/someXPage.xsp

Exception

Error while executing JavaScript action expression
Script interpreter error, line=385, col=20: 'someJavaScriptMethod()' is undefined and cannot be accessed as an array
at [/someJavaScriptFile.js].methodOne()
at [/someJavaScriptFile.js].methodTwo()
at [/someJavaScriptFile.js].methodThree()

In this specific example it is indeed possible to access the method as an array. The clue here is someJavaScriptMethod(), with no parameters. In my code, line 385(correctly pointed out), the methodcall has several parameters. When the exception is displayed as this, it usually means that at least one of the input parameters is null. This should narrow your scope when searching for the error!

Happy debugging!

1 comment:

  1. Thank you! Came across this same thing and I saw your post.

    ReplyDelete