12-16-2017 20:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

12-16-2017 20:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
The API documentation at
https://dev.fitbit.com/reference/device-api/clock/
Shows the code
import { clock } from "clock"; clock.granularity = "minutes";
Putting this into a minimal project, building, and running on my ionic gives the error
>Unhandled TypeError: Cannot set property 'granularity' of undefined
If I instead change the import to not destructure, that is
import clock from "clock"; clock.granularity = "minutes";
Then the code behaves correctly.
Other parts of the API documentation show destructuring when it is required, e.g. for display if you do not destructure then you get errors.
From display, this code is correct
import { display } from "display"; display.autoOff = false; display.on = true;
12-18-2017 17:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


12-18-2017 17:53
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks, a fix is on its way!

