Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fitbit Versa 2 development issue

ANSWERED

Hi Everyone,

 

I am testing the Fitbit CLI development, but when I try to compile a simple project, I see the following issue.

[23:21:26][error][build] package.json One or more build targets was invalid: mira
[23:21:26][error][build] package.json Error: Project configuration is invalid

 

My target is defined as:

 "buildTargets": [
      "mira"
    ],

 

and my dependencies are defined as:

"devDependencies": {
    "@fitbit/sdk": "~4.2.0",
    "@fitbit/sdk-cli": "^1.7.3"
  },

 

It seems that everything must be okay, but this error indicates that mura is not a correct buildTarget. Mura is the target for Versa2 which is the watch I want to develop applications for.

 

Have you seen such issue and how have you resolved it?

 

Thank you for your help!

Best Answer
0 Votes
27 REPLIES 27

I'm not sure if I have. I don't do regular programming work so I just followed the instructions on getting started of installing node, nvm and the rest. 

I've followed the instructions on this and this is where I've ended up:
https://dev.fitbit.com/getting-started/

 

Best Answer
0 Votes

Hi @statsdata - you need to be in the route of the project folder for any instructions and there you will find the "package.json" file, if it exists. Note @Gondwana's very good help post earlier in this topic.

Author | ch, passion for improvement.

Best Answer

npx create-fitbit-app should have created a valid package.json.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Here's a link to the SDK5 blog announcement.

Peter McLennan
Gondwana Software
Best Answer

@AnElbow I'm currently going through this same thing myself. I followed the suggestion and got "npx create-fitbit-app myVersa2Project --sdk-version 4.3.0" to work as well. I tried following the getting started guide "https://dev.fitbit.com/getting-started/" and updated the code as shown here. Of course the versa 2 is using .gui files instead of .view but the same steps. I can get a red screen and even get it to work with a custom background image, but the clock doesn't show up. Just get an exception error with the JavaScript code, it appears with this part: const myLabel = document.getElementById("myLabel"); What did you do to get your basic clock to work?

Best Answer
0 Votes

HI @Kyle_Lampela - try changing the import to SDK 4 style

import document from "document";

Author | ch, passion for improvement.

Best Answer

@Guy_Thank you so much!! It's working perfect. I guess it's easy to miss that.

Best Answer

I'm glad someone else rescued you because my fix involved importing multiple different SDK versions and I can't remember which ones and why.

Best Answer
0 Votes