oren — 3/15/2023, 10:28:21 PM

GitHub actions is literally goofy. The same code will run on Replit, but not on actions.

♥ 4 ↩ 0 💬 4 comments

comments

quantum-codes:

If you publish in a repo then I might be able to help

3/16/2023, 2:14:59 PM
oren:

Here’s the code: https://github.com/Oren-Lindsey/wasteof-nationalparks/blob/main/index.js

the specific part that doesn’t work is uploading to imgbb. It works on replit

3/16/2023, 2:45:46 PM
quantum-codes:
file:///home/runner/work/wasteof-***/wasteof-***/index.js:78
  let selectedImage = selectedPark.images[getRandomIntInclusive(0, selectedPark.images.length - 1)];
                                   ^

TypeError: Cannot read properties of undefined (reading 'images')
    at main (file:///home/runner/work/wasteof-***/wasteof-***/index.js:78:36)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.15.0
Error: Process completed with exit code 1.

By looking at the error, we can see that it errors at line 78 which is not uploading to imgbb

3/17/2023, 2:48:31 PM
oren:

run it again, the park is randomly selected so that happens sometimes when it finds one with no images

3/17/2023, 2:55:05 PM