Unable to debug SuiteScript 2.1

Oracle NetSuite is an extremely powerful and flexible ERP, and SuiteScript is one of the key tools that enables us to fulfil our customers every need.

I sure was happy when SuiteScript 2.1 was released in NetSuite 2020.1, as it allowed me to use the nice functionality of ES2019 JavaScript when developing. Previously SuiteScript was compliant only with ES5 (ES2009).

Lately I have encountered a strange error when debugging SuiteScript 2.1, that I wanted to share with you. “TypeError: r is not a function” is reported when creating a sales order in dynamic mode.

The error can easily be reproduced by running the following code in the debugger:

This problem only occurs in some NetSuite customer accounts, so if you do not get an error running the above code you are in the clear. If you do get an error however, you can also verify that the same code runs without problems when switching to SuiteScript 2.0.

After reporting it to Oracle it was confirmed to be a known defect (697132), affecting some customers, with no estimated date of resolution. Proposed alternative solutions was to not use isDynamic: true or to switch to SuiteScript 2.0.

If you, as we are, run anything but the simplest scripts in your environment, the proposed alternative solutions is probably not a viable option for you either. Let’s hope this defect will be fixed soon!


See more blog posts