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

local Storage error

ANSWERED

 so, I copy/pasted the following code from the local storage API into my project:

import { localStorage } from "local-storage";
localStorage.setItem("myKey", "myValue");
console.log(localStorage.getItem("myKey"));

and my build output keeps throwing me this error:

TypeError: Cannot create property 'code' on boolean 'true'

  • Details:
    • watchFiles: /project/app/index.js

any help would be appreciated, I am really stuck!

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions
Best Answer
0 Votes
4 REPLIES 4

I think localStorage only exists in the companion API.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

do you know the best way to implement local storage into a fitbit app?

 

*thanks for the response*

Best Answer
0 Votes

https://dev.fitbit.com/build/guides/file-system/

Peter McLennan
Gondwana Software
Best Answer
0 Votes

thanks for your time, I'll check it out!

Best Answer