Running this in the browser fails, the same goes for a cordova run (platform: browser); The cordova run with Android as target platform (phsyical device) fails for the same reason, adding that some CORS issue happened accessing pro-manifest.json.
This makes me suppose it’s a basic Angular issue with importing the Deploy module.
ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[HomePage -> Deploy]:
StaticInjectorError(Platform: core)[HomePage -> Deploy]:
NullInjectorError: No provider for Deploy!
Error: StaticInjectorError(AppModule)[HomePage -> Deploy]:
StaticInjectorError(Platform: core)[HomePage -> Deploy]:
NullInjectorError: No provider for Deploy!
I don’t see a specifc cordova module to import and the doc doesn’t mention anything in that regard.
To validate that the config is done, I run the ionic deploy add <...> command and the system confirms: Appflow Deploy plugin is already installed.
Thanks in advance for your attention and thoughts!
Hi,
Thanks; No I haven’t - actually I can’t find documentation regarding a Module that should be imported or a service added to the providers. I’m looking in the ./node_modules/
Opening , node_modules\cordova-plugin-ionic\src\browser\IonicCordovaCommon.js it shows that a dummy interface is made available to “crash gracefully” in case this cordova feature is attempted to be used via the Browser (cordova run platform browser).
So I’m missing something (possibly an obvious one), but can’t figure out what it is - a module to import, a service to provide…
function notSupported(win,fail) {
console.log('IonicCordova is not supported on browser platform');
setTimeout(function(){
if (win) {
win();
}
},0);
}
function getPreferences(win,fail) {
setTimeout(function(){
win({
minBackgroundDuration: 30,
disabled: true
});
},0);
}
module.exports = {
getPreferences: getPreferences,
getAppInfo: notSupported,
setPreferences:notSupported,
configure: notSupported
};
require("cordova/exec/proxy").add("IonicCordovaCommon", module.exports);
Also having this issue, tried doing the same stuff with adding Deploy to my app.modules.ts with same results.
Did you find the answer, or can anyone else shed some light on this?
Make sure you import Deploy from cordova-plugin-ionic/dist/ngx/ngx (2 times ngx at the end).
It is also available from cordova-plugin-ionic/dist/ngx and in many cases the IDE automatically imports it from there.
So import like this: import { Deploy } from 'cordova-plugin-ionic/dist/ngx/ngx';
And add it to your provider’s array inside app.module.ts as @shairy123 wrote above and you’re good to go.