Skip to Content

Problems preparing Hybrid Project with HAT 1.26.4

I´m developing a hybrid app using Web IDE and Hybrid Application Toolkit.

With the new version of HAT 1.26.4, I get an error when deploying the project.

Deploy -> Hybrid App Toolkit (Local Add-On) -> Prepare Hybrid Project

The deploy process fails with the following error in console:

17:31:18 (hybrid-toolkit) > Applying custom app info...
17:31:18 (hybrid-toolkit) /Users/SAP/HAT_1264/node_modules/xmlbuilder/lib/XMLStringifier.js:140
17:31:18 (hybrid-toolkit) res = str.match(/[\u0000\ud800-\udfff\ufffe-\uffff]/u);
17:31:18 (hybrid-toolkit) ^
17:31:18 (hybrid-toolkit)
17:31:18 (hybrid-toolkit) SyntaxError: Invalid flags supplied to RegExp constructor 'u'
17:31:18 (hybrid-toolkit) at new RegExp (native)17:31:18 (hybrid-toolkit) The node process of the "generate" script exited with code 1.

All prerequisites for the HAT installation has been installed.

Node 5.4.1

Cordova 6.3.1

Please suggest


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    May 08, 2017 at 10:21 PM

    Hi Jan-Ingar.

    I had this problem fixed by replacing the current version of the method XMLStringifier.prototype.assertLegalChar located in ...SAP_HAT_local-1.26.1\node_modules\xmlbuilder\lib\XMLStringifier.js by an older version of the same method which used to work (specifically from HAT 1.19.2).

    Here is the source code:

        XMLStringifier.prototype.assertLegalChar = function(str) {
          var chars, chr;
          if (this.allowSurrogateChars) {
            chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uFFFE-\uFFFF]/;
          } else {
            chars = /[\u0000-\u0008\u000B-\u000C\u000E-\u001F\uD800-\uDFFF\uFFFE-\uFFFF]/;
          chr = str.match(chars);
          if (chr) {
            throw new Error("Invalid character (" + chr + ") in string: " + str + " at index " + chr.index);
          return str;

    Here is the complete file you can use to replace yours: xmlstringifierjs.txt (don't forget to save a backup of yours).

    You can try to do the same I did.

    Hope it works for you.

    Best regards,

    Diêgo César

    Add comment
    10|10000 characters needed characters exceeded

  • May 08, 2017 at 07:21 PM

    I have the same problem after upgrading to SAP HAT 1.26.1

    Btw. I can download 1.25.3 on and 1.26.1 on SAP Store.

    Where did you download 1.26.4 ?

    Best regards

    Add comment
    10|10000 characters needed characters exceeded