SushiBtw / discord-music-player

Complete framework to facilitate music commands using discord.js v14 & v13.
https://discord-music-player.js.org/
MIT License
157 stars 65 forks source link

[BUG] Error [ERR_UNHANDLED_ERROR] when trying to play music #299

Closed ChubbyStewwa closed 2 years ago

ChubbyStewwa commented 2 years ago

Bug Description play and playlist not working I also tried it with the example code from the documentation and get the same error

Reproduction Steps Steps to reproduce the behavior:

  1. Use play or playlist command
  2. Bot join the VC but doesn't play the music
  3. following error message in the log
    node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^
    Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('Missing catch or finally after try')
        at new NodeError (node:internal/errors:371:5)
        at Player.emit (node:events:379:17)
        at FFmpeg.<anonymous> (C:\Users\sylvy\OneDrive\Discord\Bots\StewwaBot-V14\node_modules\discord-music-player\dist\managers\Queue.js:242:29)
        at FFmpeg.emit (node:events:402:35)
        at PassThrough.<anonymous> (C:\Users\sylvy\OneDrive\Discord\Bots\StewwaBot-V14\node_modules\discord-ytdl-core\index.js:1:1100)
        at PassThrough.emit (node:events:402:35)
        at runMicrotasks (<anonymous>)
        at processTicksAndRejections (node:internal/process/task_queues:96:5) {
            code: 'ERR_UNHANDLED_ERROR',
            context: 'Missing catch or finally after try'
        }

Versioning:

Zowlyfon commented 2 years ago

I had the same issue, turns out the latest version of ytdl-core is broke, downgrading to 4.10 fixed it for me.

ChubbyStewwa commented 2 years ago

I downgraded ytdl-core to the version 4.10 and I still get the same error I tried other versions too, but nothing worked

Zowlyfon commented 2 years ago

I downgraded ytdl-core to the version 4.10 and I still get the same error I tried other versions too, but nothing worked

Make sure the ytdl-core version actually downgraded by checking it's package.json in node_modules.

ChubbyStewwa commented 2 years ago

Yes, it's downgraded here the ytdl-core package.json

{
  "name": "ytdl-core",
  "description": "YouTube video downloader in pure javascript.",
  "keywords": [
    "youtube",
    "video",
    "download"
  ],
  "version": "4.10.1",
  "repository": {
    "type": "git",
    "url": "git://github.com/fent/node-ytdl-core.git"
  },
  "author": "fent <fentbox@gmail.com> (https://github.com/fent)",
  "contributors": [
    "Tobias Kutscha (https://github.com/TimeForANinja)",
    "Andrew Kelley (https://github.com/andrewrk)",
    "Mauricio Allende (https://github.com/mallendeo)",
    "Rodrigo Altamirano (https://github.com/raltamirano)",
    "Jim Buck (https://github.com/JimmyBoh)"
  ],
  "main": "./lib/index.js",
  "types": "./typings/index.d.ts",
  "files": [
    "lib",
    "typings"
  ],
  "scripts": {
    "test": "nyc --reporter=lcov --reporter=text-summary npm run test:unit",
    "test:unit": "mocha --ignore test/irl-test.js test/*-test.js --timeout 4000",
    "test:irl": "mocha --timeout 16000 test/irl-test.js",
    "lint": "eslint ./",
    "lint:fix": "eslint --fix ./",
    "lint:typings": "tslint typings/index.d.ts",
    "lint:typings:fix": "tslint --fix typings/index.d.ts"
  },
  "dependencies": {
    "m3u8stream": "^0.8.6",
    "miniget": "^4.0.0",
    "sax": "^1.1.3"
  },
  "devDependencies": {
    "@types/node": "^13.1.0",
    "assert-diff": "^3.0.1",
    "dtslint": "^3.6.14",
    "eslint": "^6.8.0",
    "mocha": "^7.0.0",
    "muk-require": "^1.2.0",
    "nock": "^13.0.4",
    "nyc": "^15.0.0",
    "sinon": "^9.0.0",
    "stream-equal": "~1.1.0",
    "typescript": "^3.9.7"
  },
  "engines": {
    "node": ">=10"
  },
  "license": "MIT"
}
Zowlyfon commented 2 years ago

Just to make sure, would you be able to try with version 4.10.0 which is what works for me?

ChubbyStewwa commented 2 years ago

Still not working 4.9.2 4.9.1 and 4.9.0 doesn't work too

ChubbyStewwa commented 2 years ago

I kept trying with different versions and now it's working with ytdl-core 4.10.0 and discord-music-player 9.0.0