Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove firebasex plugin from iOS Cordova #920

Open
1 task
rolinger opened this issue Jan 7, 2025 · 0 comments
Open
1 task

Unable to remove firebasex plugin from iOS Cordova #920

rolinger opened this issue Jan 7, 2025 · 0 comments

Comments

@rolinger
Copy link

rolinger commented Jan 7, 2025

Bug report

CHECKLIST

  • I have reproduced the issue using the example project or provided the necessary information to reproduce the issue.
  • [x ] I have checked that no similar issues (open or closed) already exist.

Current behavior:

Trying to remove the plugin: > cordova plugin rm cordova-plugin-firebasex --nosave returns the following error:

Cannot read properties of undefined (reading 'opts')

Expected behavior:
Plugin should cleanly be removed from project

Steps to reproduce:

Screenshots

Environment information

  • Cordova CLI version
    • cordova -v: 12.0
  • Cordova platform version
    • cordova platform ls cordova-ios v7.1.1
  • Plugins & versions installed in project (including this plugin)
    • cordova plugin ls v18.0.5
  • Dev machine OS and version, e.g.
    • OSX Mac
      • sw_vers: Sanoma 14.6.1
    • Windows 10
      • winver

Runtime issue

  • Device details
    -NA
  • OS details
    • NA

Android build issue: NA

iOS build issue:

  • Node JS version
    • node -v : 23.5.0
  • XCode version: 16.2

Related code:

The error is thrown on this firebasex script in ...cordova-plugin-firebasex/scripts/lib/utilities.js:

Utilities.getAppName = function(){
    if(_context.opts.cordova.platforms.indexOf('ios') !== -1){    <---------
        const projectRoot = _context.opts.projectRoot;
        const platformPath = path.join(projectRoot, 'platforms', 'ios');
        const cordova_ios = require('cordova-ios');
        const iosProject = new cordova_ios('ios', platformPath);

        return path.basename(iosProject.locations.xcodeCordovaProj);
    }
    // other platforms
    return Utilities.parseConfigXml().widget.name._text.toString().trim();
};

Console output

cordova plugin rm cordova-plugin-firebasex --nosave --verbose  

No scripts found for hook "before_plugin_rm".
Calling plugman.uninstall on plugin "cordova-plugin-firebasex" for platform "ios"
Finding scripts for "before_plugin_uninstall" hook from plugin cordova-plugin-firebasex on ios platform only.
Executing script found in plugin cordova-plugin-firebasex for hook "before_plugin_uninstall": plugins/cordova-plugin-firebasex/scripts/ios/before_plugin_uninstall.js
Cannot read properties of undefined (reading 'opts')  
TypeError: Cannot read properties of undefined (reading 'opts')
    at Utilities.getAppName (/Users/rpo/dev/myapp/plugins/cordova-plugin-firebasex/scripts/lib/utilities.js:68:17)
    at Object.getXcodeProjectPath (/Users/rpo/dev/myapp/plugins/cordova-plugin-firebasex/scripts/ios/helper.js:65:33)
    at module.exports (/Users/rpo/dev/myapp/plugins/cordova-plugin-firebasex/scripts/ios/before_plugin_uninstall.js:6:35)
    at runScriptViaModuleLoader (/Users/rpo/.nvm/versions/node/v23.5.0/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:159:32)
    at runScript (/Users/rpo/.nvm/versions/node/v23.5.0/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:138:12)
    at /Users/rpo/.nvm/versions/node/v23.5.0/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:110:40

Other information:

So far firebasex was working fine, but build times were taking for ever so I was trying to take advantage of the variable IOS_USE_PRECOMPILED_FIRESTORE_POD = true in the package.json setting. After that I attempted to remove/re-add the plugin to enable the new variable when I encountered the error. FirebaseX is so integrated I am nervous about manually trying to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant