hoerresb / WifiWizard

A Cordova plugin for managing Wifi networks
Apache License 2.0
205 stars 178 forks source link

Ionic 2 - Error: Uncaught (in promise): ReferenceError: WifiWizard is not defined ReferenceError #115

Open guazarito opened 7 years ago

guazarito commented 7 years ago

Hello all,

Could someone use WifiWizard on ionic v2?

I am trying to get the ssid like this: ` this.platform.ready().then(() => {

           let ssidHandler = (s:any) => {
        alert(s);
    }
    let fail = (e:any) => {
        alert("Please connect to your local WIFI ");
    }
    WifiWizard.getCurrentSSID(ssidHandler, fail);
});

`

But I get the error below:

Error: Uncaught (in promise): ReferenceError: WifiWizard is not defined ReferenceError: WifiWizard is not defined at http://localhost:8100/build/main.js:101:13 at t.invoke (http://localhost:8100/build/polyfills.js:3:9283) at Object.onInvoke (http://localhost:8100/build/vendor.js:4656:37) at t.invoke (http://localhost:8100/build/polyfills.js:3:9223) at r.run (http://localhost:8100/build/polyfills.js:3:4452) at http://localhost:8100/build/polyfills.js:3:14076 at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9967) at Object.onInvokeTask (http://localhost:8100/build/vendor.js:4647:37) at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9888) at r.runTask (http://localhost:8100/build/polyfills.js:3:5143) at c (http://localhost:8100/build/polyfills.js:3:13535) at http://localhost:8100/build/polyfills.js:3:14107 at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9967) at Object.onInvokeTask (http://localhost:8100/build/vendor.js:4647:37) at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9888) at r.runTask (http://localhost:8100/build/polyfills.js:3:5143) at o (http://localhost:8100/build/polyfills.js:3:2203) at HTMLAnchorElement.invoke (http://localhost:8100/build/polyfills.js:3:10985)

Can someone help me? What I am doing wrong?

THanks

damirarh commented 7 years ago

I got the same error because the plugin was not installed on the build server after the code was retrieved from source control. It was caused by the wrong plugin name being saved to config.xml when I installed the plugin.

I reported issue #116 with more details.