Xanadu ES12 in Global

NS
Kilo Sage

Hello,

 

The Xanadu highlights in docs state:

  • Use ECMAScript 2021 (ES12) features in any server-side script.

I understand this to also mean Global scope, in scoped apps this has been available since Tokyo. I spun up a PDI which is running on build `glide-xanadu-07-02-2024__patch0-07-16-2024`

Apart from `const` and `let` no new ES features seem to be working. I was trying template literals, for...of loop, arrow function and spread operator. I tried running both in a Fix Script so I could make sure the ES12 toggle was on, and in background script. But the result isn't good.

Script compilation error: Script Identifier: null.null.script, Error Description: syntax error (null.null.script; line 4), Script ES Level: 0, Interpreted Mode: true

bg script NS_1-1722858083099.png

fix script NS_0-1722858542180.png

 

In a scoped app the same script runs like a charm

NS_2-1722858129645.png

 

 

The docs also state "No plugins or properties are required to install the new JavaScript engine."  So what gives? Any ideas?

 

edit: maybe this post went into a wrong category - idk how to change it though

3 ACCEPTED SOLUTIONS

NS
Kilo Sage

Still not working in Patch 3 (glide-xanadu-07-02-2024__patch3-10-23-2024)

Got reply from SN:


Thank you for your patience on this. At this stage, we could see that the Defect has been waived for Yokohama and Targeted to Zurich. 

Will keep you posted as soon as the fix is available. 

 

View solution in original post

NS
Kilo Sage

ServiceNow finally acknowledged that the feature indeed does not work:

KB1699139 + Related Problem: PRB1794568

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1699139

 

No info on when it'll be fixed though.

View solution in original post

Hi @NS 

I can say that for my initial test in a fix script in Zurich patch 0 it works in the global scope

View solution in original post

27 REPLIES 27

NS
Kilo Sage

Still not working in Patch 3 (glide-xanadu-07-02-2024__patch3-10-23-2024)

Got reply from SN:


Thank you for your patience on this. At this stage, we could see that the Defect has been waived for Yokohama and Targeted to Zurich. 

Will keep you posted as soon as the fix is available. 

 

Simon Christens
Kilo Sage

As of early access to Yokohama - this still doesnt work as well so it seems like this issues is not related to SN build but more server sided.

Build tag: glide-yokohama-12-18-2024__patchrtp-12-19-2024

NS
Kilo Sage

Patch 5 (glide-xanadu-07-02-2024__patch5-12-24-2024) still wasn't working. SN hasn't released a public document about this. Strange behaviour IMO, just keep quiet and don't bother correcting the information that the advertised features are not working in reality.

 

"

Please be informed that the feature has been mentioned in the documentation but is not working as expected. For this reason, we have raised a PRB with our Development team and they are working on the issue. At this stage the Known article is internally posted, we will check further with the concerned team to have a customer facing known article for the visibility.

"

For testing you can create a global test script include with one test method. You can play around there and invoke this method in background script/fix script with one liner. I know that you have to write code in one tab (Script include) and execute in another tab(background script), but it nice alternative to global ECMA 2021 script playground.

Thanks Jakub, yes absolutely. But at this point that's not the issue for me. I'm more disappointed with ServiceNow's marketing in this with the docs stating "Use ECMAScript 2021 (ES12) features in any server-side script.", and the fact that they're not correcting this false claim.