Summary

      When creating a page with both Cache for Confluence (7.8.0) and Refined Themes for Confluence (6.0.6) apps installed, page is not loaded properly and a "Maximum call stack size exceeded" error is thrown.

      Steps to reproduce:

      1. Spawn a Confluence Server 6.2.3
      2. Install Cache for Confluence (7.8.0) and Refined Themes for Confluence (6.0.6) apps
      3. Set Refined Themes as Site theme (General Configuration -> Site Theme -> Confirm setting Refined Theme)
      4. Create a page with Future macro, and inside it, a Code block macro with Java as highlight (as per screenshot)
      5. Publish the page and it's an eternal "Loading app.." with error:
        Uncaught RangeError: Maximum call stack size exceeded
            at String.replace (shCore.js?locale=en-GB:1)
            at RegExp.<anonymous> (resource-init-bundle.js?data-wrm-batch-type=resource&data-wrm-key=com.refinedwiki.confluence.plugins.theme.original%3Acore-resources&locale=en-GB:7384)
            at String.replace (<anonymous>)
            at String.replace (shCore.js?locale=en-GB:173)
            at RegExp.<anonymous> (resource-init-bundle.js?data-wrm-batch-type=resource&data-wrm-key=com.refinedwiki.confluence.plugins.theme.original%3Acore-resources&locale=en-GB:7384)
            at String.replace (<anonymous>)
            at String.replace (shCore.js?locale=en-GB:173)
            at RegExp.<anonymous> (resource-init-bundle.js?data-wrm-batch-type=resource&data-wrm-key=com.refinedwiki.confluence.plugins.theme.original%3Acore-resources&locale=en-GB:7384)
            at String.replace (<anonymous>)
            at String.replace (shCore.js?locale=en-GB:173)
        

      Notes:

      • Issue does not occur for Confluence 6.10.0

            [CONFSERVER-56262] Maximum call stack size exceeded

            Just observed this on Confluence Data Center 7.19.12 LTS. Culprit was a "Code Macro" embedded on a page. Page become un-editable on Chromium based browsers (Chrome, MS Edge), Firefox still behaved normal. Replacing the Code-Macro by a Panel-Macros solved the issue.

            Not clear yet if this might be also triggered by an interference with one of our Apps installed. However, we are definitively not using Refined Theme, so it might be a different one ...

            Rainer Pöhlmann added a comment - Just observed this on Confluence Data Center 7.19.12 LTS. Culprit was a "Code Macro" embedded on a page. Page become un-editable on Chromium based browsers (Chrome, MS Edge), Firefox still behaved normal. Replacing the Code-Macro by a Panel-Macros solved the issue. Not clear yet if this might be also triggered by an interference with one of our Apps installed. However, we are definitively not using Refined Theme, so it might be a different one ...

            Hi all, 

            This is quite an old ticket by now but if anyone stumbles across this; 

            We're releasing version 7.0 of Refined for Confluence server within a few weeks, in which we've changed how these type of resources are loaded and are no longer using babel polyfill, meaning that if you're still experiencing this issue we recommend upgrading to 7.0. 

            Best regards,

            Dennis

            Refined

            Dennis Andersen added a comment - Hi all,  This is quite an old ticket by now but if anyone stumbles across this;  We're releasing version 7.0 of Refined for Confluence server within a few weeks, in which we've changed how these type of resources are loaded and are no longer using babel polyfill, meaning that if you're still experiencing this issue we recommend upgrading to 7.0.  Best regards, Dennis Refined

            Hi Alex Yakovlev,

            Thanks for responding and for your workaround. I will follow your suggestion and get back to you.

            Requesting you please update us, when you got a response from RefinedWiki team for our reference.

            Thanks

            RK

            Rama Krishna Anumola {Appfire} added a comment - - edited Hi Alex Yakovlev, Thanks for responding and for your workaround. I will follow your suggestion and get back to you. Requesting you please update us, when you got a response from RefinedWiki team for our reference. Thanks RK

            ramakrishna1, this problem has to do with babel-polyfill and syntax highlighter both trying to polyfill String methods. It appears that Refined Theme is loading babel-polyfill. When the code macro code is executed before the babel-polyfill is loaded, this infinite recursion is triggered. This is resolved in Confluence 6.7 where the babel-polyfill is loaded early from Confluence Core. A possible workaround is to load the babel-polyfill in atl.general context, for example. This could be done inside any plugin. I have tested it by loading babel-polyfill within code macro plugin as follows:

            <web-resource key="polyfill">
                <resource type="download" name="polyfill.js" location="sh/polyfill.js"/>
                <context>atl.general</context>
            </web-resource> 

            The polyfill comes from here: https://babeljs.io/docs/en/babel-polyfill.html

            You could try this inside Cache Macro and have that polyfill loaded in the general context all the time. This is only a workaround for now as, unless you are using the polyfill, you should have no reason to load it.

            As we're not likely to release further Confluence versions < 6.5, I'm going to get in contact with RefinedWiki about this issue.

            Alex Yakovlev (Inactive) added a comment - ramakrishna1 , this problem has to do with babel-polyfill and syntax highlighter both trying to polyfill String methods. It appears that Refined Theme is loading babel-polyfill. When the code macro code is executed before the babel-polyfill is loaded, this infinite recursion is triggered. This is resolved in Confluence 6.7 where the babel-polyfill is loaded early from Confluence Core. A possible workaround is to load the babel-polyfill in atl.general context, for example. This could be done inside any plugin. I have tested it by loading babel-polyfill within code macro plugin as follows: <web-resource key= "polyfill" > <resource type= "download" name= "polyfill.js" location= "sh/polyfill.js" /> <context>atl.general</context> </web-resource> The polyfill comes from here: https://babeljs.io/docs/en/babel-polyfill.html You could try this inside Cache Macro and have that polyfill loaded in the general context all the time. This is only a workaround for now as, unless you are using the polyfill, you should have no reason to load it. As we're not likely to release further Confluence versions < 6.5, I'm going to get in contact with RefinedWiki about this issue.

            Hi Support,

            Is there any ETA to address this?

            Thanks

            RK

            Rama Krishna Anumola {Appfire} added a comment - Hi Support, Is there any ETA to address this? Thanks RK

              Unassigned Unassigned
              acalantog Anne Calantog
              Affected customers:
              8 This affects my team
              Watchers:
              9 Start watching this issue

                Created:
                Updated: