Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

"Missing Command Error" when running in browser #318

Closed
EvHaus opened this issue Nov 8, 2015 · 11 comments
Closed

"Missing Command Error" when running in browser #318

EvHaus opened this issue Nov 8, 2015 · 11 comments

Comments

@EvHaus
Copy link

EvHaus commented Nov 8, 2015

After installing the plugin and calling init(), when I run the app in my browser I get this back from the "error" event:

Error: Missing Command Error
    at fail (http://localhost:8000/plugins/phonegap-plugin-push/www/push.js:55:45)
    at module.exports (http://localhost:8000/cordova.js:925:17)
    at http://localhost:8000/plugins/phonegap-plugin-push/www/push.js:61:9

This error is not descriptive enough. I don't know what's going wrong.

@h4rm
Copy link

h4rm commented Nov 8, 2015

Wrap the code in some condition so it's not executed in the browser. There simply is no backend for the javascript code in the browser because the plugin is only available on iOS, Android and Windows for obvious reasons.

@EvHaus
Copy link
Author

EvHaus commented Nov 8, 2015

Then why does the plugin mention support for the "browser" platform? That's a bit confusing.

@EvHaus EvHaus closed this as completed Nov 8, 2015
@h4rm
Copy link

h4rm commented Nov 8, 2015

That documentation states:

Supported Platforms

Android
iOS
Windows Universal

@EvHaus
Copy link
Author

EvHaus commented Nov 8, 2015

Hmm. Sorry about that. I got confused when I saw that the plugin installed itself into the "browser" platform directory.

$ cordova plugin add phonegap-plugin-push
Fetching plugin "phonegap-plugin-push" via npm
Installing "phonegap-plugin-push" for android
Installing "phonegap-plugin-push" for browser

@dorontal
Copy link

Not sure why cordova says they support the browser platform and whether it's different in phonegap.

I had the exact same 'Missing Command Error' error reported in the Chrome dev console (that's how I found this thread) and looking at the Cordova file plugin repository, they claim they do support the browser platform:

both here

https://www.npmjs.com/package/cordova-plugin-file

and here

https://github.com/apache/cordova-plugin-file

So does this mean the question still remains open?

@macdonst
Copy link
Member

@dorontal no, we added browser support awhile back.

@dorontal
Copy link

dorontal commented Oct 18, 2016

Got it, thanks. So my problem still stands. Here's my code snippet that causes it:

        window.addEventListener(
            'filePluginIsReady',
            () => {
                console.log('File plugin is ready');
                File.getFreeDiskSpace().then(
                    (arg: any) => {
                        console.log('getFreeSpace() => ' + arg);
                    },
                    (err: any) => {
                        console.log('Error calling getFreeSpace(): ' + err);
                    }
                );
            },
            false);

and here's the most recent Chrome browser's dev-console output:

File plugin is ready
Error: exec proxy not found for :: File :: getFreeDiskSpace
Error calling getFreeSpace(): Missing Command Error

[ NOTE: File is just cordova.file and the code is in Typescript. ]

Has anyone seen similar problems reported:

  • exec proxy not found
  • Missing Command Error

when trying to use the cordova / phonegap file plugin in chrome?

I read both the 'chrome quirks' and 'browser quirks' sections of the README but did not see anything applicable - perhaps I missed something.

Thanks!

EDIT: my apologies, just realized I posted here in the wrong place. It may not be related to the original question. Will figure out where to post appropriately.

@Tulika12
Copy link

error "Missing Command Error"

@davinci0428
Copy link

davinci0428 commented Apr 4, 2018

I too need an answer to this and I can't find it anywhere. What is the final answer? If browser support was in fact added, as macdonst stated, then what's the cause of the error? If browser support doesn't exist then the Couchbase PhoneGap Getting Started guide needs to not represent that it does exist. The guide clearly shows the app running in a Chrome browser with Developer Tools open, as well as explicitly represents that it does run in a browser.
image

@rlam3
Copy link

rlam3 commented Apr 7, 2018

Are we supposed to see this message? I got this message when I tried adding cordova-plugins-admob-free into cordova plugins.

Does this mean that are certain plugins that only work with iOS/android/windows phone and won't be able to show up on browser?

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

7 participants