Hey all,
I’m trying to get the Geolocation
plugin working for Ionic4 project. I got the installation without any errors. However when I load the page, I get
ERROR in ./node_modules/@ionic-native/geolocation/index.js
Module not found: Error: Can't resolve 'rxjs/Observable' in `<path>/node_modules/@ionic-native/geolocation'
here is my .ts class
import { Component } from '@angular/core';
import { Geolocation } from '@ionic-native/geolocation';
@Component({
selector: 'app-tab2',
templateUrl: 'tab2.page.html',
styleUrls: ['tab2.page.scss']
})
export class Tab2Page {
constructor(private geolocation: Geolocation) {}
}
I had a quick search and I found kind of similar issues for camera and google plus. They both suggests to add ngx
at the end of the import. However adding that to the Geolocation gives me this error
Module not found: Error: Can't resolve '@ionic-native/geolocation/ngx'
What could I be doing wrong here ? Following is my ionic config
Ionic:
ionic (Ionic CLI) : 4.6.0 (/Users/sameeragayan/.nvm/versions/node/v10.14.2/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-rc.0
@angular-devkit/build-angular : 0.11.4
@angular-devkit/schematics : 7.1.4
@angular/cli : 7.1.4
@ionic/angular-toolkit : 1.2.2
Cordova:
cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.1, (and 5 other plugins)
System:
Android SDK Tools : 26.1.1 (/Users/sameeragayan/Library/Android/sdk)
ios-deploy : 1.9.4
ios-sim : 7.0.0
NodeJS : v10.14.2 (/Users/sameeragayan/.nvm/versions/node/v10.14.2/bin/node)
npm : 6.5.0
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61
Thanks in advance
cheers,
Sam