I'm moving a clockface I developed in Studio into a local node.js project.
I'm getting the following error:
App: Unhandled exception: TypeError: Expected a function.
? at app/index.js:14,7
`document` is clearly defined, so I'm baffled by this.
I tried the basic Fitbit example at https://dev.fitbit.com/getting-started/ and it has the same issue. This is a Versa 2 project using SDK ~4.3.0 with "mira" as the target.
import clock from "clock";
import * as document from "document";
import { preferences } from "user-settings";
import * as util from "../resources/utils";
import { HeartRateSensor } from "heart-rate";
import { me as appbit } from "appbit";
import { today as toDay } from "user-activity";
import { battery } from "power";
// update the clock every minute
clock.granularity = "minutes";
// THE PROBLEM IS HERE
const theTime = document.getElementById("theTime");
Best Answer