jef / streetmerchant

🤖 The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.96k stars 1.3k forks source link

[Bug]: Discord fails to send message due to AbortController is not defined #2776

Closed Kore-Development closed 2 years ago

Kore-Development commented 2 years ago

Expected Behavior

Successful Discord message sending

Current Behavior

Error

What operating system are you seeing the problem on?

Windows

Relevant log output

[9:47:14 PM] error :: ✖ couldn't send discord message AbortController is not defined {
  "name": "ReferenceError",
  "code": 500,
  "method": "post",
  "path": "[removed]",
  "requestData": {
    "json": {
      "content": "<@[removed]> <@[removed]>",
      "tts": false,
      "embeds": [
        {
          "title": "_**Stock alert!**_",
          "type": "rich",
          "description": "> provided by [streetmerchant](https://github.com/jef/streetmerchant) with :heart:",
          "url": null,
          "timestamp": "2021-09-22T02:47:14.593Z",
          "color": 5420936,
          "fields": [
            {
              "name": "Store",
              "value": "test:name",
              "inline": true
            },
            {
              "name": "Price",
              "value": "100",
              "inline": true
            },
            {
              "name": "Product Page",
              "value": "https://www.example.com/url",
              "inline": false
            },
            {
              "name": "Add to Cart",
              "inline": false
            },
            {
              "name": "Brand",
              "value": "test:brand",
              "inline": true
            },
            {
              "name": "Model",
              "value": "test:model",
              "inline": true
            },
            {
              "name": "Series",
              "value": "test:series",
            }
          ],
          "thumbnail": {
            "url": "https://raw.githubusercontent.com/jef/streetmerchant/main/docs/assets/images/streetmerchant-logo.png"
          },
          "image": null,
          "author": null,
          "footer": null
        }
      ],
      "username": "streetmerchant"
    },
    "files": []
  },
  "stack": "ReferenceError: AbortController is not defined\n    at RequestHandler.execute (C:\\Users\\itzko\\streetmerchant\\node_modules\\discord.js\\src\\rest\\RequestHandler.js:172:15)\n    at RequestHandler.execute (C:\\Users\\itzko\\streetmerchant\\node_modules\\discord.js\\src\\rest\\RequestHandler.js:176:19)\n    at RequestHandler.push (C:\\Users\\itzko\\streetmerchant\\node_modules\\discord.js\\src\\rest\\RequestHandler.js:50:25)\n    at processTicksAndRejections (internal/process/task_queues.js:95:5)\n    at async WebhookClient.send (C:\\Users\\itzko\\streetmerchant\\node_modules\\discord.js\\src\\structures\\Webhook.js:169:15)"
}

Configuration

# ** All configuration variables are optional **
# Copy this file and name it as `dotenv` (without backticks)
# Read https://jef.buzz/streetmerchant/getting-started/#customization for help on customizing this file
########################################################################################################

ASCII_BANNER=
ASCII_COLOR=
APNS_AUTHKEY=
APNS_BUNDLEID=
APNS_DEVICETOKEN=
APNS_KEYID=
APNS_PRODUCTION=
APNS_TEAMID=
AUTO_ADD_TO_CART=
BROWSER_TRUSTED=
CAPTCHA_HANDLER_CAPTURE_TYPE=
CAPTCHA_HANDLER_POLL_INTERVAL=
CAPTCHA_HANDLER_RESPONSE_TIMEOUT=
CAPTCHA_HANDLER_SERVICE=discord
CAPTCHA_HANDLER_TOKEN=[removed]
CAPTCHA_HANDLER_USER_ID=[removed]
DESKTOP_NOTIFICATIONS=true
DISCORD_NOTIFY_GROUP=<@[removed]>
DISCORD_NOTIFY_GROUP_3060=
DISCORD_NOTIFY_GROUP_3060TI=
DISCORD_NOTIFY_GROUP_3070=
DISCORD_NOTIFY_GROUP_3070TI=
DISCORD_NOTIFY_GROUP_3080=
DISCORD_NOTIFY_GROUP_3080TI=
DISCORD_NOTIFY_GROUP_3090=
DISCORD_NOTIFY_GROUP_CORSAIR_SF=
DISCORD_NOTIFY_GROUP_RX6800=
DISCORD_NOTIFY_GROUP_RX6800XT=
DISCORD_NOTIFY_GROUP_RX6900XT=
DISCORD_NOTIFY_GROUP_RYZEN5600=
DISCORD_NOTIFY_GROUP_RYZEN5800=
DISCORD_NOTIFY_GROUP_RYZEN5900=
DISCORD_NOTIFY_GROUP_RYZEN5950=
DISCORD_NOTIFY_GROUP_SONYPS5C=<@[removed]>
DISCORD_NOTIFY_GROUP_SONYPS5DE=
DISCORD_NOTIFY_GROUP_XBOXSX=
DISCORD_NOTIFY_GROUP_XBOXSS=
DISCORD_NOTIFY_GROUP_TEST=<@[removed]>
DISCORD_WEB_HOOK=[removed]
EMAIL_PASSWORD=[removed]
EMAIL_TO=[removed]
EMAIL_USERNAME=[removed]
GOTIFY_PRIORITY=
GOTIFY_TOKEN=
GOTIFY_URL=
HEADLESS=
IN_STOCK_WAIT_TIME=300
INCOGNITO=
LOG_LEVEL=
LOW_BANDWIDTH=
MAX_PRICE_SERIES_3060=
MAX_PRICE_SERIES_3060TI=
MAX_PRICE_SERIES_3070=
MAX_PRICE_SERIES_3070TI=
MAX_PRICE_SERIES_3080=
MAX_PRICE_SERIES_3080TI=
MAX_PRICE_SERIES_3090=
MAX_PRICE_SERIES_CORSAIR_SF=
MAX_PRICE_SERIES_RX6800=
MAX_PRICE_SERIES_RX6800XT=
MAX_PRICE_SERIES_RX6900XT=
MAX_PRICE_SERIES_RYZEN5600=
MAX_PRICE_SERIES_RYZEN5800=
MAX_PRICE_SERIES_RYZEN5900=
MAX_PRICE_SERIES_RYZEN5950=
MAX_PRICE_SERIES_SONYPS5C=600
MAX_PRICE_SERIES_SONYPS5DE=
MAX_PRICE_SERIES_XBOXSS=
MAX_PRICE_SERIES_XBOXSX=
MAX_PRICE_SERIES_TEST=
MICROCENTER_LOCATION=
MQTT_BROKER_ADDRESS=
MQTT_BROKER_PORT=
MQTT_CLIENT_ID=
MQTT_PASSWORD=
MQTT_QOS=
MQTT_TOPIC=
MQTT_USERNAME=
OPEN_BROWSER=false
PAGE_BACKOFF_MIN=300000
PAGE_BACKOFF_MAX=3600000
PAGE_SLEEP_MIN=300000
PAGE_SLEEP_MAX=600000
PAGE_TIMEOUT=
PAGERDUTY_INTEGRATION_KEY=
PAGERDUTY_SEVERITY=
PHILIPS_HUE_API_KEY=
PHILIPS_HUE_CLOUD_ACCESS_TOKEN=
PHILIPS_HUE_CLOUD_CLIENT_ID=
PHILIPS_HUE_CLOUD_CLIENT_SECRET=
PHILIPS_HUE_CLOUD_REFRESH_TOKEN=
PHILIPS_HUE_LAN_BRIDGE_IP=
PHILIPS_HUE_LIGHT_COLOR=
PHILIPS_HUE_LIGHT_IDS=
PHILIPS_HUE_LIGHT_PATTERN=
PHONE_CARRIER=verizon
PHONE_NUMBER=[removed]
PLAY_SOUND=
SOUND_PLAYER=
PROXY_ADDRESS=
PROXY_PROTOCOL=
PROXY_PORT=
PUSHBULLET=[removed]
PUSHOVER_EXPIRE=
PUSHOVER_DEVICE=
PUSHOVER_PRIORITY=
PUSHOVER_RETRY=
PUSHOVER_SOUND=
PUSHOVER_TOKEN=
PUSHOVER_USER=
RESTART_TIME=
SCREENSHOT=
SHOW_ONLY_BRANDS=sony,test:brand
SHOW_ONLY_MODELS=ps5 console,test:model
SHOW_ONLY_SERIES=sonyps5c,test:series
SLACK_CHANNEL=
SLACK_TOKEN=
SMTP_ADDRESS=smtp.gmail.com
SMTP_PORT=587
STORES=amazon,amd,antonline,ao,argos,aria,arlt,asus,awd,azerty,bandh,bestbuy,box,bpm-power,bt,canadacomputers,caseking,ccl,comet,computeruniverse,coolblue,coolmod,corsair,currys,cyberport,drako,ebuyer,elcorteingles,elkjop,eprice,equippr,euronics,evga,expert,futurex,galaxus,game,gamestop,globaldata,hardware-planet,johnlewis,mediamarkt,medimax,megekko,ldlc,memoryexpress,microcenter,mightyape,mindfactory,multicom,neobyte,newegg,noelleeming,notebooksbilliger,novatech,officedepot,ollo,opirata,otto,overclockers,pccomponentes,pcdiga,pcking,playstation,pny,saturn,scan,shopto,siabyte,smythstoys,spielegrotte,target,thewarehouse,topachat,toysrus,unieuro,ultimainformatica,very,vsgamers,vuugo,wipoid,xtremmedia,zotac
TELEGRAM_ACCESS_TOKEN=
TELEGRAM_CHAT_ID=
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_FROM_NUMBER=
TWILIO_TO_NUMBER=
TWITCH_ACCESS_TOKEN=
TWITCH_CHANNEL=
TWITCH_CLIENT_ID=
TWITCH_CLIENT_SECRET=
TWITCH_REFRESH_TOKEN=
TWITTER_ACCESS_TOKEN_KEY=
TWITTER_ACCESS_TOKEN_SECRET=
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_TWEET_TAGS=
STREAMLABS_ACCESS_TOKEN=
STREAMLABS_TYPE=
STREAMLABS_IMAGE=
STREAMLABS_SOUND=
STREAMLABS_DURATION=
FREEMOBILE_ID=
FREEMOBILE_API_KEY=
WEB_PORT=3546

Code of Conduct

jef commented 2 years ago

Is this still happening?

vp-regular commented 2 years ago

This happens because discord.js v13 requires node>=v16.6. I believe the sm docs still suggest to use node 15.

https://discordjs.guide/additional-info/changes-in-v13.html#before-you-start

jef commented 2 years ago

Ah, good call out. I will update this.