Uploaded image for project: 'Red Hat Developer Hub Bugs'
  1. Red Hat Developer Hub Bugs
  2. RHDHBUGS-1071

`export-dynamic-plugin` fails to find dependencies nested deeper than one level in `node_modules`

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 1.4.0
    • 1.4.0, 1.5.0
    • Dynamic Plugins
    • None
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • Hide
      = Improved dependency resolution for embedded packages in CLI

      Previously, the CLI examined the dependencies of embedded packages during the export process by calling require from the monorepo root. This could lead to incorrect dependency resolution, especially when wrapping an existing plugin.

      With this update, the CLI now calls require from the embedded package's parent directory, ensuring that the most relevant dependencies are correctly identified and used.
      Show
      = Improved dependency resolution for embedded packages in CLI Previously, the CLI examined the dependencies of embedded packages during the export process by calling require from the monorepo root. This could lead to incorrect dependency resolution, especially when wrapping an existing plugin. With this update, the CLI now calls require from the embedded package's parent directory, ensuring that the most relevant dependencies are correctly identified and used.
    • Bug Fix
    • Done
    • RHDH Dynamic Plugins 3266

      Description of problem:

      The export-dynamic-plugin command encounters an issue when a required dependency is located more than one level deep within the node_modules directory structure. This commonly occurs when different plugins depend on varying versions of the same package. In such cases, the top-level node_modules might contain a version different from the one actually required by the plugin being exported.

      While the correct dependency version does exist deeper within the node_modules hierarchy (e.g., within the node_modules folder of another dependency), the export-dynamic-plugin command fails to locate it. This results in a failed export, even though the necessary dependency is present within the project.

      Prerequisites (if any, like setup, operators/versions):

      Steps to Reproduce:

      1. Create a Backstage project with a plugin that depends on package 'A' version 1.0.0.
      2. Add another plugin which depends on a different version of package 'A', for example 2.0.0. This will likely install it directly under node_modules, causing the version mismatch.
      3. Add another dependency package 'B' which depends on package 'A' version 1.0.0. Package 'B' would therefore have it's own package 'A' v1.0.0 located under node_modules/B/node_modules/A.
      4. Try to export the first plugin using the export-dynamic-plugin command.

      Actual results:

      The export-dynamic-plugin command fails to locate the required dependency version and throws an error, halting the export process.

      Expected results:

      The export-dynamic-plugin command should successfully locate and include the correct version of the dependency, regardless of its nesting level within the node_modules structure. The export should complete without errors.

      Reproducibility (Always/Intermittent/Only Once):

      Always

      Build Details:

      Additional info (Such as Logs, Screenshots, etc):

              stlewis_2 Stan Lewis
              pschultz@redhat.com Paul Schultz
              RHIDP - Dynamic Plugins
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: