Uploaded image for project: 'PUBLIC - Liferay Alloy UI'
  1. PUBLIC - Liferay Alloy UI
  2. AUI-2022

ACE Editor module fails when used after initial page load.

    Details

    • Type: Regression Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.x
    • Fix Version/s: None
    • Component/s: ACE Editor
    • Labels:
      None

      Description

      An error is thrown when the the ACE Editor's aui-ace-editor module is used in a YUI sandbox after the initial page load.

      Steps to reproduce:

      1. Copy the following html into a file:
         <html>
             <head>
                 <title>test</title>
                 <script src="/Path/to/alloy-ui/build/aui/aui-min.js"></script>
                 <link href="/Path/to/alloy-ui/build/aui-css/css/bootstrap.min.css" rel="stylesheet" />
             </head>
             <body>
                 <strong>Initially Rendered</strong><div id="initial"></div>
                 <button id="button" onclick="YUI().use('aui-button', function(A) { new A.Button({ render: true, srcNode: '\x23button' });}); YUI().use('aui-ace-editor', function(A) { alert('dynamic'); });">button</button>
                 <script type="text/javascript">
                     YUI().use('aui-ace-editor', function(A) {
                         new A.AceEditor({ render: true, boundingBox: '\x23initial' });
                     });
                 </script>
             </body>
         </html>
        
      2. Fix the paths to the js and css to point to the latest AlloyUI 3 build.
      3. Open the file in a browser.
      4. Click the button.

      If the bug still exists, an error will appear in the browser logs, and the dynamic alert will not appear.

      In Firefox, the following error will appear:

      TypeError: r.modules is undefined
      

      In Chrome, the following error will appear:

      Uncaught TypeError: Cannot read property 'ace/ace' of undefined
      

      Note: In AlloyUI 2.0.0 and 3.0.1, this bug did not exist.

      Note 2: Other modules that I've tested (such as aui-button in the example) work correctly with no errors when used after the initial page load.

        Attachments

          Activity

            People

            Assignee:
            ui_alloy UI Alloy
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            3 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              4 years, 29 weeks, 4 days ago

                Packages

                Version Package