XWiki Platform
  1. XWiki Platform
  2. XWIKI-13772

A warning is displayed on the log when a Flamingo Theme is being edited

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 7.3, 8.3-rc-1
    • Fix Version/s: 8.3, 8.4-rc-1, 7.4.6
    • Component/s: Flamingo Theme
    • Labels:
      None
    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      Just edit a flamingo theme and look at the console:

      2016-10-05 15:36:39,919 [http://localhost:8080/xwiki/bin/jsx/FlamingoThemesCode/ThemeSheet?language=en&docVersion=1.1] WARN  c.x.x.w.s.JsExtension          - Error at line 82, column 84: il manque un nom après un opérateur '.'. Caused by: [        iframe[0].contentWindow.lessJs.modifyVars(varMap).then(removeCurtain).catch(removeCurtain);] 
      2016-10-05 15:36:39,922 [http://localhost:8080/xwiki/bin/jsx/FlamingoThemesCode/ThemeSheet?language=en&docVersion=1.1] ERROR c.x.x.w.s.JsExtension          - Runtime error minimizing JSX object: Compilation produced 1 syntax errors. 
      2016-10-05 15:36:39,923 [http://localhost:8080/xwiki/bin/jsx/FlamingoThemesCode/ThemeSheet?language=en&docVersion=1.1] WARN  c.x.x.w.s.JsExtension          - Failed to compress JS extension: null 
      

      This error is actually wrong (the JS code is perfectly valid) but this message appears for some reason.

        Issue Links

          Activity

          Hide
          Guillaume Delhumeau added a comment -

          I suspect this is because of the .catch. The JS minimizer might not support try..catch with promises: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch

          Show
          Guillaume Delhumeau added a comment - I suspect this is because of the .catch . The JS minimizer might not support try..catch with promises: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/catch
          Hide
          Guillaume Delhumeau added a comment - - edited

          Currently we use yuicompressor 2.4.7.
          The last version is 2.4.8, but it does not claim that it supports the promises.
          Changelog is here:https://github.com/yui/yuicompressor/blob/master/doc/CHANGELOG

          What hurts me is that the last changes have been made 3 years ago, and I read that it has been replaced by yuglify. However, it's a nodeJs project.

          Show
          Guillaume Delhumeau added a comment - - edited Currently we use yuicompressor 2.4.7. The last version is 2.4.8, but it does not claim that it supports the promises. Changelog is here: https://github.com/yui/yuicompressor/blob/master/doc/CHANGELOG What hurts me is that the last changes have been made 3 years ago, and I read that it has been replaced by yuglify . However, it's a nodeJs project.
          Hide
          Guillaume Delhumeau added a comment - - edited

          It seems Google Closure could be a replacement, or UglifyJS-java which is a wrapper for the JS library I mentioned above.

          Show
          Guillaume Delhumeau added a comment - - edited It seems Google Closure could be a replacement, or UglifyJS-java which is a wrapper for the JS library I mentioned above.
          Hide
          Guillaume Delhumeau added a comment - - edited

          Workaround (good for backporting without changing all our JS minifier infrastructure):
          replace

          iframe[0].contentWindow.lessJs.modifyVars(varMap).then(removeCurtain).catch(removeCurtain);
          

          by

          iframe[0].contentWindow.lessJs.modifyVars(varMap).then(removeCurtain)['catch'](removeCurtain);
          
          Show
          Guillaume Delhumeau added a comment - - edited Workaround (good for backporting without changing all our JS minifier infrastructure): replace iframe[0].contentWindow.lessJs.modifyVars(varMap).then(removeCurtain). catch (removeCurtain); by iframe[0].contentWindow.lessJs.modifyVars(varMap).then(removeCurtain)[' catch '](removeCurtain);
          Hide
          Guillaume Delhumeau added a comment -

          Introduced by XWIKI-12656 in 7.3M1.

          Show
          Guillaume Delhumeau added a comment - Introduced by XWIKI-12656 in 7.3M1.
          Show
          Marius Dumitru Florea added a comment - See http://stackoverflow.com/questions/25774628/is-the-catch-method-name-of-js-promises-a-invalid-since-its-a-js-keyword

            People

            • Assignee:
              Guillaume Delhumeau
              Reporter:
              Guillaume Delhumeau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: