12-16-2017 20:11
12-16-2017 20:11
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
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
12-18-2017 17:53
Thanks, a fix is on its way!
Best Answer