Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13725

Circular module dependency

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 7.0.0
    • 7.0.0
    • cordova-lib
    • Patch

    Description

      There is a circular dependency within the util.js file (src/cordova/util.js) and the platforms.js file (src/platforms/platforms.js).

      This circular dependency causes the platforms variable to equal an empty JavaScript object ({}); as a result when within the getPlatformApiFunction the else condition !platforms[platform] on line 498 is always trigerred causing deprecated platforms to always fail upon attempted addition to the project.

      This bug also seems to affect the hostSupports function on line 94.

      Can someone more versed in this components inner workings confirm if this is indeed a bug? I would be happy to attempt a fix if it is but would need to discuss my idea for a potential fix with a more experienced dev first to ensure I don't break hidden dependencies.

      Potential fix:

      On line 30 change var platforms = require('../platforms/platforms'); to var platforms = require('../platforms/platformsConfig.json');

      Attachments

        Activity

          People

            Unassigned Unassigned
            jdegiovanni Jake Degiovanni
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: