10-06-2017 08:50 - edited 10-06-2017 08:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-06-2017 08:50 - edited 10-06-2017 08:51
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I can't get Promise working when using TypeScript.
My code is:
import geolocation from 'geolocation'; export function getCurrentLocation(): Promise<any> { return new Promise<any>((resolve: any, reject: any) => { geolocation.getCurrentPosition((position: any) => { resolve(position.coords); }, (error: any) => { reject(error); }); }); }
When building I get the error:
/companion/util.ts (4,14): TS2693: 'Promise' only refers to a type, but is being used as a value here.
Answered! Go to the Best Answer.

Accepted Solutions
10-09-2017 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-09-2017 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
TypeScript is not officially supported by Fitbit Studio yet, but as a temporary solution:
declare const Promise: any;
I took this from your own message on Discord 🙂

10-09-2017 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


10-09-2017 08:21
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
TypeScript is not officially supported by Fitbit Studio yet, but as a temporary solution:
declare const Promise: any;
I took this from your own message on Discord 🙂

