tonesto7 / fordpass-scriptable

FordPass Widget for Scriptable
GNU General Public License v3.0
169 stars 27 forks source link

Error on line 1811:23: Expected value of type string but got value of type null #25

Closed OtherTimDavis closed 2 years ago

OtherTimDavis commented 2 years ago

I received this error after I copied down the latest script code ver1.2.3

Error log text 2021-12-17 19:54:41: Script Update Available: false 2021-12-17 19:54:41: missing: fpDeviceLanguage,fpLanguage,fpTz,fpPressureUnits,fpSpeedUnits 2021-12-17 19:54:43: (Config Menu) Done was pressed 2021-12-17 19:54:44: Error on line 1811:23: Expected value of type string but got value of type null.

IMG_0185

Thank you,

Tim

tonesto7 commented 2 years ago

Hi,

Please try this version of the script and tell me if it solves your issues. https://gist.githubusercontent.com/...8ead3ec218b97a568a4a79b2/Fordpass%20Widget.js

Review the log output after saving your login and vin for any errors, and make sure the data looks valid

OtherTimDavis commented 2 years ago

Thank you for the reply. I clicked on the link for the new code and received the following error.

{"error":"Not Found"}

Thank you,

Tim

tonesto7 commented 2 years ago

Seems to have truncated the link https://gist.githubusercontent.com/tonesto7/942bda23e3228f16f324bf4e68fec6d2/raw/8075bd534b60d90d1af57ef56297e2a85086b3f4/Fordpass%2520Widget.js

OtherTimDavis commented 2 years ago

Below are the lines from the log.

2021-12-18 01:00:33: Script Version: 1.2.4 | Update Available: false | Latest Version: 1.2.1 2021-12-18 01:00:33: Required Prefs Missing: fpDeviceLanguage,fpLanguage,fpTz,fpPressureUnits,fpSpeedUnits 2021-12-18 01:00:38: (Config Menu) Done was pressed 2021-12-18 01:00:38: (Required Prefs Menu) Error: ReferenceError: Can't find variable: fpUser 2021-12-18 01:00:38: Error on line 1000:50: ReferenceError: Can't find variable: fpUser

tonesto7 commented 2 years ago

this is crazy... I don't understand how it got in this state. please edit the script and enable the clearKeychainOnNextRun and run the script then disable it. I need to make sure you are starting in a clean state

merccat commented 2 years ago

Also experiencing the same thing (the null value in 1811 w/version 1.2.3) and the Can't find variable: fpUser with the version above.

i tried setting the keychain to clear and it did but the same error happened.

Sorry, not much help, haven’t had a chance to pull down the code to somewhere I can read it.

mattwolkoff commented 2 years ago

I was having the same issue described. the alternate code you shared resulted in the same error the other user shared.

2021-12-18 01:00:38: Error on line 1000:50: ReferenceError: Can't find variable: fpUser

i just commented out the console.logs around line 1000, and your code ran and also resolved the original issue.

tonesto7 commented 2 years ago

yep... there are a few issues i'm working through right now. Thanks for your understanding

OtherTimDavis commented 2 years ago

I cleared the keychain as you asked. I received the same error.

2021-12-18 13:59:40: Script Version: 1.2.4 | Update Available: false | Latest Version: 1.2.1 2021-12-18 13:59:40: Info: Clearing Authentication from Keychain 2021-12-18 13:59:40: Required Prefs Missing: fpUser,fpPass,fpToken2,fpVin,fpMapProvider,fpCountry,fpDeviceLanguage,fpLanguage,fpTz,fpPressureUnits,fpSpeedUnits 2021-12-18 14:00:45: (Config Menu) Done was pressed 2021-12-18 14:00:45: (Required Prefs Menu) Error: ReferenceError: Can't find variable: fpUser 2021-12-18 14:00:45: Error on line 1000:50: ReferenceError: Can't find variable: fpUser

Tim

tonesto7 commented 2 years ago

This should be resolved with v1.3.0 https://raw.githubusercontent.com/tonesto7/fordpass-scriptable/main/Fordpass%20Widget.js