GovTechSG/purple-a11y

Unable to run an audit starting with the 07/14/2023 portable release

jcrain23 opened this issue · 10 comments

Hello,
I've been able to use PurpleHats with any release after 07/04.

I execute "Node Index" and it just stops. I found this in "errors.txt":
{"timestamp":"2023-08-22 11:50:11","level":"error","message":"uncaughtException: Unexpected end of JSON input\nSyntaxError: Unexpected end of JSON input\n at JSON.parse ()\n at getUserDataTxt (file:///C:/Users/Jackc/Desktop/Purple0822/purple-hats/utils.js:68:27)\n at file:///C:/Users/Jackc/Desktop/Purple0822/purple-hats/constants/questions.js:12:18\n at ModuleJob.run (node:internal/modules/esm/module_job:193:25)\n at async Promise.all (index 0)\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\n at async loadESM (node:internal/process/esm_loader:91:5)\n at async handleMainPromise (node:internal/modules/run_main:65:12)"}

Can you help? I'd like to take advantage of the latest updates. I'm on Windows10

Hi @jcrain23

Thanks for your feedback. We have resolved the node index in v0.9.13.

Thank you!!! I'm downloading the latest release, cool to see we'll be able to specify the path for results. I do miss the old excel export, but I'm making due. :-)

@younglim Different issue with the latest release. I'll debug on my end to see if I can figure anything out, but I'm not a coder. {"timestamp":"2023-08-24 09:23:35","level":"error","message":"uncaughtException: Unexpected end of JSON input\nSyntaxError: Unexpected end of JSON input\n at JSON.parse ()\n at getUserDataTxt (file:///C:/Users/Jackc/Desktop/Purple_0824/purple-hats/utils.js:74:27)\n at file:///C:/Users/Jackc/Desktop/Purple_0824/purple-hats/constants/questions.js:12:18\n at ModuleJob.run (node:internal/modules/esm/module_job:193:25)\n at async Promise.all (index 0)\n at async ESMLoader.import (node:internal/modules/esm/loader:530:24)\n at async loadESM (node:internal/process/esm_loader:91:5)\n at async handleMainPromise (node:internal/modules/run_main:65:12)"}

Hi @jcrain23,

Would you try to remove userData.txt by running the following command?
rm "$env:APPDATA\Purple HATS\userData.txt"

Then retry node index again.

@younglim Figured it out.userData.txt is being created empty. After putting in {} and saving userData.txt it runs fine.

@younglim I spoke to soon. While I was able to get up to the point if it asking me the URL of the website to test, it would execute.
image

@younglim Ah! Missing folders in the download zip
image

The Chromium and other browsers have been removed since v0.9.13 to reduce download size.

Run the command similar to the mentioned in your PowerShell output, or simple the following to install Chromium:
npx playwright install chromium

Hope this helps!

@younglim Figured it out.userData.txt is being created empty. After putting in {} and saving userData.txt it runs fine.

You would minimally the following within userData.txt
{"name":"USERNAME","email":"USERNAME@users.noreply.github.com"}

Thanks @younglim, installing Chromium did the trick. I'm up and running! Have a great day!