title: Uncaught (in promise): cordova_not_available in Ionic 2
body: <p>When I'm running my Ionic app with <code>ionic serve -l</code> command, get following error message: </p>
  
  <blockquote>
    <p><strong>Runtime Error</strong></p>
    
    <p>Uncaught (in promise): cordova_not_available</p>
  </blockquote>
  
  <p><strong>Stack</strong></p>
  
  <pre><code>Error: Uncaught (in promise): cordova_not_available
  at v (http://localhost:8100/build/polyfills.js:3:4864)
  at s (http://localhost:8100/build/polyfills.js:3:4289)
  at s (http://localhost:8100/build/polyfills.js:3:4112)
  at http://localhost:8100/build/polyfills.js:3:4652
  at t.invokeTask (http://localhost:8100/build/polyfills.js:3:10284)
  at Object.onInvokeTask (http://localhost:8100/build/main.js:38692:37)
  at t.invokeTask (http://localhost:8100/build/polyfills.js:3:10220)
  at e.runTask (http://localhost:8100/build/polyfills.js:3:7637)
  at i (http://localhost:8100/build/polyfills.js:3:3707)
  at HTMLDocument.invoke (http://localhost:8100/build/polyfills.js:3:11437)
  </code></pre>
  
  <p>other details</p>
  
  <pre><code>Ionic Framework: 2.2.0
  Ionic Native: 2.8.1
  Ionic App Scripts: 1.1.4
  Angular Core: 2.4.8
  Angular Compiler CLI: 2.4.8
  Node: 6.9.2
  OS Platform: Windows 10
  Navigator Platform: Win32
  User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
  </code></pre>
  
  <p>I Install <a href="https://ionicframework.com/docs/v2/native/hotspot/" rel="nofollow noreferrer">HotSpot</a> plugin, with following command :</p>
  
  <pre><code>ionic plugin add cordova-plugin-hotspot --save
  
  cordova plugin add cordova-plugin-hotspot --save
  </code></pre>
  
  <p><strong>Usage</strong> app.component.ts</p>
  
  <pre><code>import { Component } from '@angular/core';
  import { Platform } from 'ionic-angular';
  import { StatusBar, Splashscreen,Hotspot,Network } from 'ionic-native';
  import { TabsPage } from '../pages/tabs/tabs';
  
  
  @Component({
   templateUrl: 'app.html'
  })
  
  export class MyApp {
  rootPage = TabsPage;
  
   constructor(platform: Platform) {
  
    platform.ready().then(() =&gt; {
       StatusBar.styleDefault();
       Splashscreen.hide();
       Hotspot.scanWifi().then((networks: Array&lt;Network&gt;) =&gt; {
       console.log(networks);
  
   });
  })
     }
    }
  </code></pre>
  
  <p>Also, I saw similar <a href="https://stackoverflow.com/questions/38744657/ionic-2-error-cordova-not-available/40824822#40824822">questions</a> but they didn't solve the problem.</p>