Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Find Name #5

Open
ShawnPavel opened this issue Oct 5, 2017 · 6 comments
Open

Cannot Find Name #5

ShawnPavel opened this issue Oct 5, 2017 · 6 comments

Comments

@ShawnPavel
Copy link

I am attempting to update to v1.1.1 and I get the following errors on compilation:

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(3,59): error TS2304: Cannot find name 'UIApplication'.

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(8,28): error TS2304: Cannot find name 'UIBackgroundFetchResult'.
@christocracy
Copy link
Member

Add references.d.ts in your app folder.

@ShawnPavel
Copy link
Author

ShawnPavel commented Oct 5, 2017

I added the reference like so:

/// <reference path="./node_modules/nativescript-background-fetch/references.d.ts" />

Now I get two more errors looking for tns-platform-declarations in the plugin's node_modules folder:

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(3,59): error TS2304: Cannot find name 'UIApplication'.

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(8,28): error TS2304: Cannot find name 'UIBackgroundFetchResult'.

node_modules/nativescript-background-fetch/references.d.ts(1,1): error TS6053: File '/Users/shawnpavel/Development/mobileClassic/node_modules/nativescript-background-fetch/node_modules/tns-platform-declarations/ios.d.ts' not found.

node_modules/nativescript-background-fetch/references.d.ts(2,1): error TS6053: File '/Users/shawnpavel/Development/mobileClassic/node_modules/nativescript-background-fetch/node_modules/tns-platform-declarations/android.d.ts' not found.

@christocracy
Copy link
Member

christocracy commented Oct 5, 2017

$ tns plugin remove nativescript-background-geolocation-lt
$ tns plugin remove nativescript-background-fetch
$tns platform remove ios
$ tns platform remove android
$ tns plugin add nativescript-background-geolocation-lt

Rebuild/run

@ShawnPavel
Copy link
Author

Doing exactly as you have written above, I get the same errors as above. If I change the references line to reference background-geolocation's references.d.ts file I get this instead:

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(3,59): error TS2304: Cannot find name 'UIApplication'.

node_modules/nativescript-background-fetch/background-fetch.ios.d.ts(8,28): error TS2304: Cannot find name 'UIBackgroundFetchResult'.

node_modules/nativescript-background-geolocation-lt/references.d.ts(1,1): error TS6053: File '/Users/shawnpavel/Development/mobileClassic/node_modules/nativescript-background-geolocation-lt/node_modules/tns-platform-declarations/ios.d.ts' not found.

node_modules/nativescript-background-geolocation-lt/references.d.ts(2,1): error TS6053: File '/Users/shawnpavel/Development/mobileClassic/node_modules/nativescript-background-geolocation-lt/node_modules/tns-platform-declarations/android.d.ts' not found.

node_modules/nativescript-background-geolocation-lt/references.d.ts(4,14): error TS2300: Duplicate identifier 'FormData'.
node_modules/nativescript-background-geolocation-lt/references.d.ts(5,14): error TS2300: Duplicate identifier 'Headers'.
node_modules/nativescript-background-geolocation-lt/references.d.ts(6,14): error TS2300: Duplicate identifier 'RequestInit'.
node_modules/nativescript-background-geolocation-lt/references.d.ts(7,14): error TS2300: Duplicate identifier 'Response'.
node_modules/nativescript-background-geolocation-lt/references.d.ts(8,14): error TS2300: Duplicate identifier 'Console'.

node_modules/tns-core-modules/declarations.d.ts(15,11): error TS2300: Duplicate identifier 'RequestInit'.

node_modules/tns-core-modules/declarations.d.ts(36,15): error TS2300: Duplicate identifier 'Headers'.
node_modules/tns-core-modules/declarations.d.ts(56,15): error TS2300: Duplicate identifier 'Response'.
node_modules/tns-core-modules/declarations.d.ts(87,11): error TS2300: Duplicate identifier 'Console'.

node_modules/typescript/lib/lib.d.ts(6134,11): error TS2300: Duplicate identifier 'Console'.

node_modules/typescript/lib/lib.d.ts(6159,13): error TS2300: Duplicate identifier 'Console'.
node_modules/typescript/lib/lib.d.ts(7621,11): error TS2300: Duplicate identifier 'FormData'.
node_modules/typescript/lib/lib.d.ts(7625,13): error TS2300: Duplicate identifier 'FormData'.

I confirmed that there is not a node_modules/tns-core-modules within the nativescript-background-geolocation-lt folder. Which is where it is looking according to the error.

Note: I'm running the 2.5 version of nativescript at the moment.
tns-info:

┌──────────────────┬─────────────────┬────────────────┬──────────────────┐
│ Component        │ Current version │ Latest version │ Information      │
│ nativescript     │ 2.5.5           │ 3.2.1          │ Update available │
│ tns-core-modules │ 2.5.1           │ 3.2.0          │ Update available │
│ tns-android      │ 2.5.0           │ 3.2.0          │ Update available │
│ tns-ios          │                 │ 3.2.0          │ Not installed    │
└──────────────────┴─────────────────┴────────────────┴──────────────────┘

@christocracy
Copy link
Member

Come chat me at my web site: http://www.transistorsoft.com

@frpatino6
Copy link

i have a same error,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants