Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-81374

npm bundle processor fails for modules having dependencies that contain the string 'function' in their names

    Details

      Description

      When deploying a bundle containing npm packages with one or more modules that have any dependency which names contains the string "function", like for example:

      Liferay.Loader.define(
        'my-package@1.0.0/index', 
        ['module', 'exports', 'require', './_a-function', './_is-object'], 
        function() {
          console.log('Hi there');
        }
      );

      The FlatNPMBundleProcessor gets fooled and stops parsing the dependencies at that point. So, in the above example, the processor would not detect the './is-object' dependency.

      Steps to reproduce:

      1. Start portal
      2. Deploy attached OSGi bundle
      3. Open a browser and request "http://localhost:8080/o/js_loader_modules"
      4. Look for "LPS-81374@1.0.0/index" (it may appear more than once) until the following is found:

      Expected results:

      1. Make sure that all "./_a-function", "./_is-object", and "./_invoke" dependencies appear (not just "module", "exports", and "require")

      Actual results:

      1. Only "module", "exports", and "require" appear.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 21 weeks, 6 days ago

                Packages

                Version Package
                7.0.0 DXP FP49
                7.0.0 DXP SP8
                7.0.X
                7.1.0 Beta 2
                7.1.X
                Master