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

cordova-browser@5 doesn't add with cordova<7

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: browser@5.0.0
    • Fix Version/s: 5.0.1
    • Component/s: None

      Description

      cordova platform add browser@latest --nofetch
      Warning: using prerelease version 7.0.2-dev (cordova-lib@7.0.2-dev)
      Adding browser project...
      Unable to load PlatformApi from platform. Error: Cannot find module 'cordova-common'
      Error: Uncaught, unspecified "error" event. (The platform "browser" does not appear to be a valid cordova platform. It is missing API.js. browser not supported.)
      

      I believe cordova-common wasn't properly bundled into cordova-browser@5. Works fine if I add it locally. Easy fix

        Issue Links

          Activity

          Hide
          markdark Mark Veenstra added a comment -

          Is this issue still on the radar? cordova-browser@5 or even any cordova-browser platform does not work anymore with cordova@7.1.0

          Show
          markdark Mark Veenstra added a comment - Is this issue still on the radar? cordova-browser@5 or even any cordova-browser platform does not work anymore with cordova@7.1.0
          Hide
          csddavies Doug Davies added a comment - - edited

          I'm seeing this too It also seems to be leaving behind a "prepare" director in the root when it fails. I used "phonegap prepare" and specify the platforms in config.xml for installation. Also, after it fails to install, if I do a "cordova run browser" then it of course fails to run, but it also leaves behind a "run" directory in the root. I think the same thing happens with "cordova platform add browser". The "platform" directory gets left behind.

          Show
          csddavies Doug Davies added a comment - - edited I'm seeing this too It also seems to be leaving behind a "prepare" director in the root when it fails. I used "phonegap prepare" and specify the platforms in config.xml for installation. Also, after it fails to install, if I do a "cordova run browser" then it of course fails to run, but it also leaves behind a "run" directory in the root. I think the same thing happens with "cordova platform add browser". The "platform" directory gets left behind.
          Hide
          stevegill Steve Gill added a comment -

          Sorry guys, need to do a browser release to fix this. I'll start it today

          Show
          stevegill Steve Gill added a comment - Sorry guys, need to do a browser release to fix this. I'll start it today
          Hide
          stevegill Steve Gill added a comment -

          Browser release is out. It should work now.

          Show
          stevegill Steve Gill added a comment - Browser release is out. It should work now.
          Hide
          markdark Mark Veenstra added a comment -

          Steve Gill Today I tried to update again to latest cordova with the latest browser platform, but still no success:

          user@user-laptop:~/Documenten/Projects/client$ cordova prepare --verbose
          Resolving module name for q => q
          Checking config.xml and package.json for saved platforms that haven't been added to the project
          Config.xml and package.json platforms are different. Updating package.json with most current list of platforms.
          Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
          Discovered platform "browser@5.0.1" in config.xml or package.json. Adding it to the project
          Resolving module name for q => q
          Using cordova-fetch for cordova-browser@5.0.1
          Running command: npm install cordova-browser@5.0.1 --production --no-save
          Command finished with error code 0: npm install,cordova-browser@5.0.1,--production,--no-save
          Error: CordovaError: Failed to fetch platform cordova-browser@5.0.1
          Probably this is either a connection problem, or platform spec is incorrect.
          Check your connection and platform name/version/URL.
          Failed to get absolute path to installed module
              at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:329:25
              at _rejected (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/q/q.js:797:24)
              at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/q/q.js:823:30
              at Promise.when (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:1142:31)
              at Promise.promise.promiseDispatch (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:808:41)
              at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:624:44
              at runSingle (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:137:13)
              at flush (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:125:13)
              at _combinedTickCallback (internal/process/next_tick.js:73:7)
              at process._tickCallback (internal/process/next_tick.js:104:9)
          
          Show
          markdark Mark Veenstra added a comment - Steve Gill Today I tried to update again to latest cordova with the latest browser platform, but still no success: user@user-laptop:~/Documenten/Projects/client$ cordova prepare --verbose Resolving module name for q => q Checking config.xml and package .json for saved platforms that haven't been added to the project Config.xml and package .json platforms are different. Updating package .json with most current list of platforms. Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms. Discovered platform "browser@5.0.1" in config.xml or package .json. Adding it to the project Resolving module name for q => q Using cordova-fetch for cordova-browser@5.0.1 Running command: npm install cordova-browser@5.0.1 --production --no-save Command finished with error code 0: npm install,cordova-browser@5.0.1,--production,--no-save Error: CordovaError: Failed to fetch platform cordova-browser@5.0.1 Probably this is either a connection problem, or platform spec is incorrect. Check your connection and platform name/version/URL. Failed to get absolute path to installed module at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/platform/addHelper.js:329:25 at _rejected (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/q/q.js:797:24) at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/q/q.js:823:30 at Promise.when (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:1142:31) at Promise.promise.promiseDispatch (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:808:41) at /home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:624:44 at runSingle (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:137:13) at flush (/home/mva/.nvm/versions/node/v6.10.1/lib/node_modules/cordova/node_modules/cordova-fetch/node_modules/q/q.js:125:13) at _combinedTickCallback (internal/process/next_tick.js:73:7) at process._tickCallback (internal/process/next_tick.js:104:9)

            People

            • Assignee:
              stevegill Steve Gill
              Reporter:
              stevegill Steve Gill
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development