Skip to content

code: 'ERR_UNHANDLED_REJECTION' ReferenceError: document is not defined #155

@LeoneVi

Description

@LeoneVi

I’ve noticed that this error appears only when downloading multi-page PDFs. Single-page PDFs still seem to work.
Maybe there were recent changes to MuseScore, another MuseScore downloader I was using recently started failing after the first page only.

PDFs that failed to download:

PDFs that successfully downloaded:

Error:

 ~ npx dl-librescore@latest

? MuseScore URL or path to file or folder:
  (starts with https://musescore.com/ or is a path) 
  https://musescore.com/user/4609986/scores/1749181
! ID: 1749181
  Title: Waltz in A Minor(Chopin)
  Continue? Yes

? Filetype Selection pdf
? Output Directory: /Users/Tory
⠂ Processing…ReferenceError: document is not defined
    at /Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:5119:41
    at Generator.next (<anonymous>)
    at /Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:14:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:10:12)
    at getApiAuthNetwork (/Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:5069:44)
    at /Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:5186:26
    at Generator.next (<anonymous>)
    at fulfilled (/Users/Tory/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:11:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
node:internal/process/promises:330
      new UnhandledPromiseRejection(reason);
      ^

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "function Error() { [native code] }".
    at throwUnhandledRejectionsMode (node:internal/process/promises:330:7)
    at processPromiseRejections (node:internal/process/promises:413:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:32) {
  code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v25.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions