-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New V8 runtime Error and Data Download Error with workarounds (from a newb) #39
Comments
Hey @katmd14, just wanted to say that your documentation above is excellent :) Don't sell yourself short! |
Hey all, I've followed PR#37 and I'm getting "TypeError: Cannot read properties of undefined (reading 'getContentText')" when I try to download my data. My authorization has worked but I'm not 100% sure whats going on here |
No clue if anyone monitors this anymore either lol |
I get this every now and then and through trial and error found that if the "start date" goes back further than 3 months it will throw this error. Keeping the date range within the last 3 months seems to fix it. Also, changing the date from the Fitbit > Setup menu sometimes doesn't fix the issue and so I have to do it manually in the Extensions > App Script > Project Settings tab. Hope this helps, it's what works for me (so far) but I know that it might not work for everyone. 🤞 |
I tried your fix of changing the date in the setup menu and it didn't seem to work @pjfarr. can you explain what you do in the project setting tab? |
In the Project Settings tab (1), if you scroll down you'll see a section named Script Properties (2) and, below that, a box for entering the date. Click the "Edit Script Properties" button (3) and then change the date manually (4) (follow the exact date format—for me it's YYYY-MM-DD). Click "Save script properties" (5) afterward. Go back and reload the sheet the script's attached to. This fixes it for me. |
Sadly still the same error on my end :( Mind you i don't have the
Loggables property but I am using the heartrate.gs file. do I need this?
…On Thu, Sep 14, 2023 at 9:52 AM pjfarr ***@***.***> wrote:
In the Project Settings tab (1), if you scroll down you'll see a section
named Script Properties (2) and, below that, a box for entering the date.
Click the "Edit Script Properties" button (3) and then change the date
manually (4) *(follow the exact date format—for me it's YYYY-MM-DD).*
Click "Save script properties" (5) afterward. Go back and reload the sheet
the script's attached to.
This fixes it for me.
[image: Screenshot Project Settings - Apps Script]
<https://user-images.githubusercontent.com/8330627/267997228-0375210b-0cc3-4c9c-98a9-6d8fbe4d4aa0.png>
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXCQCOWPC2QW6JHFDARG4F3X2MD3DANCNFSM4NVKOPNQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Sorry it didn't work for you, I know this stuff is frustrating and I'm by no means an expert. |
Don’t worry about it! I’m new to JS (mostly done python in the past) so I’m
learning so you are an expert to me!
This is the first time
…On Thu, Sep 14, 2023 at 11:23 AM pjfarr ***@***.***> wrote:
Sorry it didn't work for you, I know this stuff is frustrating and I'm by
no means an expert.
Was this script working for you before and then suddenly stopped? Or is
this the first time you've tried using it?
—
Reply to this email directly, view it on GitHub
<#39 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXCQCORDP7PKJPQQCFIQW7TX2MOPLANCNFSM4NVKOPNQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The "Loggables" parameter sets up the data categories I want to import (Calories in/out, steps, distance, etc.) I don't use heartrate.gs, it's a separate script I believe. Maybe it aggregates info differently, although the error is the same one I was getting. The script I use is intraday.gs. A few years back Google changed the way they exchange secure data and it broke the script. The folks here adapted it and got it working again. I remember the nightmare it was for me trying to update the script I had due to many customizations I had made to it but eventually got it working. I'm not sure if this affected the heartrate.gs script too (probably), but if you haven't already, try looking over the info in the README.md file on the <>Code page here. It's been a long time since I set all this up so a lot of it is fuzzy now. Sorry I couldn't be more help. |
I have very limited coding experience, and recently went to use the original code by @simonbromberg. I ran into 3 issues that were not addressed in the initial setup instructions, last updated in 2018. I thought I would put them here for other newbs who are just trying to get their Fitbit data.
The first issue is that Google's script editor has been switched over to V8 runtime; which seems to have happened around Feb 2020. This meant that I needed to use the latest version (38) of the OAuth2.0 library, not version 19 as was mentioned.
I needed to tweak the First Date in the gs script to get the data. I had to set the 'getFirstDate' function to the day I was pulling info from. It is defaulted to 01/01/2012 and would not save as any other date for me. I just changed the date in the gs code to be the current date and was able to pull this info when I went to Download Data later.
The remaining issues I ran into have already been addressed in @lordneeko's post and @rubenflamshepherd's post.
The second issue was that the UI has been deprecated. This was well addressed by @lordneeko in his PR#37 post. You just use the Setup.html code and save it as Setup in the script editor and then use the respective gs codes he has listed (intraday.gs, heartrate.gs, etc.) as you would have previously. @pjfarr explained how to do this well in his reply on @lordneeko 's post.
The final issue was that the Project Key for the callback URL did not work for me and I instead used the script ID setup discussed in this post by Jozef Jarosciak and by @rubenflamshepherd's post.
I have only used the heartrate.gs file so far, and it worked. Adjusting for these 3 issues and the date seemed to do the trick. Jozef Jarosciak's instructions were very helpful for someone lacking experience.
**I don't know a lot of the jargon, so I apologize if some of my terminology was off.
The text was updated successfully, but these errors were encountered: