Ionic-native bunch of warnings of cannot resolve files?


#1

This is the output after installing ionic-native, geolocation plugin and importing it in a page:


WARNING in ./~/ionic-native/dist/index.js
Cannot find source file '../src/index.ts': Error: Cannot resolve 'file' or 'directory' ../src/index.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist

WARNING in ./~/ionic-native/dist/ng1.js
Cannot find source file '../src/ng1.ts': Error: Cannot resolve 'file' or 'directory' ../src/ng1.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist

WARNING in ./~/ionic-native/dist/plugins/actionsheet.js
Cannot find source file '../../src/plugins/actionsheet.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/actionsheet.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/admob.js
Cannot find source file '../../src/plugins/admob.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/admob.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/appavailability.js
Cannot find source file '../../src/plugins/appavailability.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/appavailability.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/apprate.js
Cannot find source file '../../src/plugins/apprate.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/apprate.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/appversion.js
Cannot find source file '../../src/plugins/appversion.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/appversion.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/badge.js
Cannot find source file '../../src/plugins/badge.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/badge.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/background-geolocation.js
Cannot find source file '../../src/plugins/background-geolocation.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/background-geolocation.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/barcodescanner.js
Cannot find source file '../../src/plugins/barcodescanner.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/barcodescanner.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/base64togallery.js
Cannot find source file '../../src/plugins/base64togallery.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/base64togallery.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/batterystatus.js
Cannot find source file '../../src/plugins/batterystatus.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/batterystatus.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/ble.js
Cannot find source file '../../src/plugins/ble.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/ble.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/bluetoothserial.js
Cannot find source file '../../src/plugins/bluetoothserial.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/bluetoothserial.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/calendar.js
Cannot find source file '../../src/plugins/calendar.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/calendar.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/camera.js
Cannot find source file '../../src/plugins/camera.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/camera.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/clipboard.js
Cannot find source file '../../src/plugins/clipboard.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/clipboard.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/contacts.js
Cannot find source file '../../src/plugins/contacts.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/contacts.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/datepicker.js
Cannot find source file '../../src/plugins/datepicker.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/datepicker.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/dbmeter.js
Cannot find source file '../../src/plugins/dbmeter.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/dbmeter.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/device.js
Cannot find source file '../../src/plugins/device.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/device.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/deviceaccounts.js
Cannot find source file '../../src/plugins/deviceaccounts.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/deviceaccounts.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/devicemotion.js
Cannot find source file '../../src/plugins/devicemotion.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/devicemotion.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/deviceorientation.js
Cannot find source file '../../src/plugins/deviceorientation.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/deviceorientation.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/diagnostic.js
Cannot find source file '../../src/plugins/diagnostic.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/diagnostic.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/dialogs.js
Cannot find source file '../../src/plugins/dialogs.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/dialogs.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/emailcomposer.js
Cannot find source file '../../src/plugins/emailcomposer.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/emailcomposer.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/facebook.js
Cannot find source file '../../src/plugins/facebook.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/facebook.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/file.js
Cannot find source file '../../src/plugins/file.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/file.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/filetransfer.js
Cannot find source file '../../src/plugins/filetransfer.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/filetransfer.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/flashlight.js
Cannot find source file '../../src/plugins/flashlight.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/flashlight.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/geolocation.js
Cannot find source file '../../src/plugins/geolocation.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/geolocation.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/globalization.js
Cannot find source file '../../src/plugins/globalization.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/globalization.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/googlemaps.js
Cannot find source file '../../src/plugins/googlemaps.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/googlemaps.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/googleanalytics.js
Cannot find source file '../../src/plugins/googleanalytics.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/googleanalytics.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/hotspot.js
Cannot find source file '../../src/plugins/hotspot.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/hotspot.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/imagepicker.js
Cannot find source file '../../src/plugins/imagepicker.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/imagepicker.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/inappbrowser.js
Cannot find source file '../../src/plugins/inappbrowser.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/inappbrowser.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/insomnia.js
Cannot find source file '../../src/plugins/insomnia.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/insomnia.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/keyboard.js
Cannot find source file '../../src/plugins/keyboard.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/keyboard.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/launchnavigator.js
Cannot find source file '../../src/plugins/launchnavigator.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/launchnavigator.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/localnotifications.js
Cannot find source file '../../src/plugins/localnotifications.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/localnotifications.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/media.js
Cannot find source file '../../src/plugins/media.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/media.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/network.js
Cannot find source file '../../src/plugins/network.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/network.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/push.js
Cannot find source file '../../src/plugins/push.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/push.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/screenshot.js
Cannot find source file '../../src/plugins/screenshot.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/screenshot.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/sms.js
Cannot find source file '../../src/plugins/sms.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/sms.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/socialsharing.js
Cannot find source file '../../src/plugins/socialsharing.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/socialsharing.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/spinnerdialog.js
Cannot find source file '../../src/plugins/spinnerdialog.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/spinnerdialog.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/splashscreen.js
Cannot find source file '../../src/plugins/splashscreen.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/splashscreen.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/sqlite.js
Cannot find source file '../../src/plugins/sqlite.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/sqlite.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/statusbar.js
Cannot find source file '../../src/plugins/statusbar.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/statusbar.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/toast.js
Cannot find source file '../../src/plugins/toast.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/toast.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/touchid.js
Cannot find source file '../../src/plugins/touchid.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/touchid.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/vibration.js
Cannot find source file '../../src/plugins/vibration.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/vibration.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/webintent.js
Cannot find source file '../../src/plugins/webintent.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/webintent.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/plugins/plugin.js
Cannot find source file '../../src/plugins/plugin.ts': Error: Cannot resolve 'file' or 'directory' ../../src/plugins/plugin.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist/plugins

WARNING in ./~/ionic-native/dist/util.js
Cannot find source file '../src/util.ts': Error: Cannot resolve 'file' or 'directory' ../src/util.ts in /mnt/LinHDD/Carlos/Programming/taoappionic2/node_modules/ionic-native/dist


#2

That path ./~/ is suspicuous, how are you importing or how are you getting those warnings?


#3

In the exact moment i used this as the docs say those warnings pop up, also could it have to do with i using webpack as the bundler?:

import {Geolocation} from 'ionic-native'
...
constructor(...) {
    Geolocation.getCurrentPosition({
      enableHighAccuracy: true,
      timeout: 5000
    })
    .then((resp) => {
      //resp.coords.latitude
      //resp.coords.longitude
      this.conf.showAlert({
        title: 'GeoLocation: ',
        template: `Coords: ${Util.JSONStringify({ latitude: resp.coords.latitude, longitude: resp.coords.longitude }, null, 2)}`
      })
    }, (err) => {
      console.log(err)
      this.conf.showAlert({
        title: 'Error obteniendo la geolocalización',
        template: `Razon ${Util.JSONStringify(err, null, 2) }`
      })
    })
}

#5

Maybe the configuration of your bundler or editor linter, or a conflict between both.
Your bundler looking for the libraries in the home dir ~ but the linter looking for a relative path ./, never happened to me as I dont customize that stuff so deep.


#6

Is there typings for ionic-native?


#7

They are inside the ionic-native package:

"typings": "./dist/index.d.ts"

#8

Then it should be automatically loaded, and it is now that i remember since when using the ionic native geolocation, typing support showed the intellisense suggestions.