Closed Badisi closed 5 years ago
Yep, as soon as I upgraded to Cordova 9, I got this error:
Jacobs-MacBook-Pro:src-cordova jacob$ cordova prepare --verbose
Executing script found in plugin cordova-custom-config for hook "before_prepare": plugins/cordova-custom-config/hooks/restoreBackups.js
Cannot read property 'reject' of undefined
TypeError: Cannot read property 'reject' of undefined
at module.exports (/Users/jacob/workspace/tc/src-cordova/plugins/cordova-custom-config/hooks/restoreBackups.js:134:18)
at runScriptViaModuleLoader (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:181:32)
at runScript (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:157:16)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/hooks/HooksRunner.js:125:20
at process.runNextTicks [as _tickCallback] (internal/process/next_tick.js:47:5)
at Function.Module.runMain (internal/modules/cjs/loader.js:865:11)
at internal/main/run_main_module.js:21:11
Fix published to npm in cordova-custom-config@5.1.0
I'm using 5.1.0 but still got that error. Was it solved on your end? @Badisi
What stacktrace do you see if you run cordova prepare --verbose
? There are a lot of other plugins out there that also need to be updated.
it's in the error dpogue linked
That stacktrace is the old plugin version. 5.1 doesn't call reject on line 134. You should make sure it was updated.
ok, how do i see if it's updated? my config.xml of cordova says <plugin name="cordova-custom-config" spec="^5.1.0" />
Editing the version in config.xml and running cordova prepare doesn't update plugin. You need to remove and re-add the plugin using cordova cli.
it's my first cordova project I just got from other company (that went bankrupt) the code. please tell me how to update.
ok it works now. thanks!
@Annelies1 how did you manage to remove it, as when I call ionic cordova plugin remove cordova-custom-config --verbose
I get the same stack as you did:
TypeError: Cannot read property 'reject' of undefined
at module.exports (c:\Users\medmondev\Documents\Source\Repos\ajbic-client-mobile\plugins\cordova-custom-config\hooks\restoreBackups.js:135:18)
at runScriptViaModuleLoader (C:\Users\medmondev\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:181:32)
at runScript (C:\Users\medmondev\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:157:16)
at C:\Users\medmondev\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:125:20
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
[ERROR] An error occurred while running subprocess cordova.
The unique way (which I found) to do this work is to downgrade cordova to 8.1.2
npm unnistall cordova -g
npm install -g cordova@8.1.2
I got TypeError: Cannot read property 'reject' of undefined also with cordova@9 had to downgrade like diegosomar can this be fixed?
I'm submitting a ...
Bug report
Current behavior:
Nightly build of cordova makes backward-incompatible changes.
ERROR: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it.
A new major version of this plugin might probably need to be released in order to support it.
Steps to reproduce:
Use the latest cordova nightly build along with this plugin.
Environment information