LukeHagar / plexjs

A Typescript SDK for interacting with Plex Media Server
MIT License
21 stars 0 forks source link

Is this entire library broken? #20

Closed DorianTheGrey closed 3 weeks ago

DorianTheGrey commented 3 months ago

I am puzzled, has anything changed and has broken this entire library? I tested my token with curl and it works on the same machine, but using even the most basic example (e.g. getServerCapabilities) with the same data gives me the following every time:

node:internal/deps/undici/undici:12502
      Error.captureStackTrace(err, this);
            ^

TypeError: fetch failed
    at node:internal/deps/undici/undici:12502:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HTTPClient.request (/home/jan/plexindex/node_modules/@lukehagar/plexjs/lib/http.js:46:25)
    at async Server.do$ (/home/jan/plexindex/node_modules/@lukehagar/plexjs/lib/sdks.js:84:24)
    at async Server.getServerCapabilities (/home/jan/plexindex/node_modules/@lukehagar/plexjs/sdk/server.js:95:26)
    at async run (file:///home/jan/plexindex/index.js:9:18) {
  [cause]: ConnectTimeoutError: Connect Timeout Error
      at onConnectTimeout (node:internal/deps/undici/undici:6635:28)
      at node:internal/deps/undici/undici:6587:50
      at Immediate._onImmediate (node:internal/deps/undici/undici:6619:13)
      at process.processImmediate (node:internal/timers:478:21) {
    code: 'UND_ERR_CONNECT_TIMEOUT'
  }
}

Node.js v20.15.0

LukeHagar commented 3 months ago

Hey Dorian!

Thanks for brining up this issue.

I’ll look into it and circle back with what I find.

LukeHagar commented 3 months ago

Can you share what your usage looks like? is this just a simple TS file?

DorianTheGrey commented 3 months ago

Hi Luke,

Thanks for coming back to me!

Sure, my pleasure to share. I attached:

  1. Project.png, just a screenshot from the project folder
  2. Index.png, showing you the index.js
  3. Package.png, showing you the package.json content
  4. Ubunturelease.png, just to ensure it’s 22.04 (Node.js is version 20.15.0)
  5. Output.png shows the output with the error by simply running: node index.js
  6. Curl.png shows the working curl result on the same machine with the same token.

If I didn’t miss anything that seems like the very basic example on your Github page. Your wrapper looks really great and I would love to be able to use it. Thanks again for having a look!

Cheers,

Jan

From: Luke Hagar @.> Sent: Dienstag, 9. Juli 2024 06:01 To: LukeHagar/plexjs @.> Cc: DorianTheGrey @.>; Author @.> Subject: Re: [LukeHagar/plexjs] Is this entire library broken? (Issue #20)

Can you share what your usage looks like? is this just a simple TS file?

— Reply to this email directly, view it on GitHub https://github.com/LukeHagar/plexjs/issues/20#issuecomment-2216425207 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMM7X4V3P2KL7XY5MFFRPLDZLNN6RAVCNFSM6AAAAABKRFSM6OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJWGQZDKMRQG4 . You are receiving this because you authored the thread. https://github.com/notifications/beacon/AMM7X4VQDNB4EOX6DMP3CFDZLNN6RA5CNFSM6AAAAABKRFSM6OWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUEDP3PO.gif Message ID: @. @.> >

LukeHagar commented 2 months ago

Hey @DorianTheGrey, it looks like the images you tried to attach didn't come through

LukeHagar commented 3 weeks ago

Happy to reopen this if you are able to assist with more information