roblav96 / nativescript-telephony

A Nativescript plugin to get the device's SIM data (carrier name, mcc mnc, country code, telephonenumber, etc)
Other
22 stars 9 forks source link

Fix webpack bundling support #4

Closed sis0k0 closed 7 years ago

sis0k0 commented 7 years ago

related: https://github.com/NativeScript/nativescript-dev-webpack/issues/81 fixes: #1, #3

roblav96 commented 7 years ago

@sis0k0

let you = 'winning'

Thank you =]

abhayastudios commented 7 years ago

Open source at its best ;)

Thanks both!

abhayastudios commented 7 years ago

Actually I am still getting an error after updating to the latest changes. Now I get the message Could not find module 'nativescript-telephony' even when just running tns run ios:

file:///app/pages/login.js:6:39: JS ERROR Error: Could not find module 'nativescript-telephony'. Computed path '<computed path>/app/tns_modules/nativescript-telephony'.

$ ls -la <computed path>/app/tns_modules/nativescript-telephony
total 64
drwxr-xr-x   9 joni  staff   306 Feb 24 21:01 .
drwxr-xr-x  55 joni  staff  1870 Feb 24 21:01 ..
-rw-r--r--   1 joni  staff    55 Feb 24 21:01 .npmignore
-rw-r--r--   1 joni  staff  1124 Feb 24 21:01 LICENSE
-rw-r--r--   1 joni  staff  2415 Feb 24 21:01 README.md
-rw-r--r--   1 joni  staff   124 Feb 24 21:01 index.d.ts
-rw-r--r--   1 joni  staff  6883 Feb 24 21:01 package.json
-rw-r--r--   1 joni  staff    51 Feb 24 21:01 telephony.d.ts
-rw-r--r--   1 joni  staff   330 Feb 24 21:01 tsconfig.json

Looks to me like somehow the code itself is not copied into the target directory? Maybe an issue in the new package.json?

I am invoking the plugin like this:

import {Telephony} from 'nativescript-telephony';

Telephony().then((info) => {
  console.dump(info);
}, (error) => {
  console.log('Unable to retrieve SIM info');
});
roblav96 commented 7 years ago

@abhayastudios delete your node_modules folder and reinstall.