Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Cannot find name 'CLAuthorizationStatus' #189

Closed
ZeroCoolJr opened this issue Jan 25, 2019 · 5 comments · Fixed by #192
Closed

Cannot find name 'CLAuthorizationStatus' #189

ZeroCoolJr opened this issue Jan 25, 2019 · 5 comments · Fixed by #192
Assignees
Labels

Comments

@ZeroCoolJr
Copy link

ZeroCoolJr commented Jan 25, 2019

Full error message

node_modules/nativescript-geolocation/location-monitor.d.ts(112,48): error TS2304: Cannot find name 'CLAuthorizationStatus'. TypeScript compiler failed with exit code 1

Which platform(s) does your issue occur on?

  • only have Android emulator that tns configured automatically

Please, provide the following version numbers that your issue occurs with:

  • CLI: 5.1.1
  • Cross-platform modules: 5.1.2
  • Runtime(s): tns-android & tns-ios= 5.1.0
  • Plugin(s):
    "dependencies": {
    "nativescript-geolocation": "^4.4.0",
    "nativescript-theme-core": "~1.0.4",
    "tns-core-modules": "~5.1.0"
    },
    "devDependencies": {
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "~0.19.0",
    "tslint": "~5.11.0"
    }

Please, tell us how to recreate the issue in as much detail as possible.

Error appears when doing tns run android but the project continues to run.

Is there any code involved?

Tried to to import only what's needed which is getCurrentLocation rather than import * as geolocation from "nativescript-geolocation"; but it still displays the error.

@mikkeldamm
Copy link

Until the type is added and the issue is fixed, then you can add the following to your references.d.ts:

declare type CLAuthorizationStatus = void;

The reason i'm choosing void is because I don't know the actual type 🙈

@fernandomr
Copy link

Hi, I got this error today too.
I downgraded the plugin to 4.3.1 version and it works for my projects. This 4.3.1 version was the one I were using here before I upgraded today to this new version, which brings the error.

@tbozhikov
Copy link
Contributor

Hi @ZeroCoolJr, thank you for reporting this. Do you reproduce that in the plugin's demo projects? I did not manage to do that there. Also, do you have

    "tns-platform-declarations": "^5.1.0"

in your package.json's devDependencies and references.d.ts file with:

/// <reference path="../src/node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="../src/node_modules/tns-platform-declarations/android.d.ts" />

It would be great if you can send source code of the entire app that reproduces this error. Thanks!

@tbozhikov
Copy link
Contributor

Found the issue, ignore the previous comment.

@charlie884
Copy link

Hi, I got this error today too.
I downgraded the plugin to 4.3.1 version and it works for my projects. This 4.3.1 version was the one I were using here before I upgraded today to this new version, which brings the error.

Work it!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
5 participants