Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'removeAllListeners' of null #19

Closed
dwffls opened this issue Apr 5, 2021 · 7 comments
Closed

TypeError: Cannot read property 'removeAllListeners' of null #19

dwffls opened this issue Apr 5, 2021 · 7 comments
Assignees

Comments

@dwffls
Copy link

dwffls commented Apr 5, 2021

Hi there,

Love what you're making here, and thinking of porting it to home assistant when I get it working.

However I get the following error when running any command:
TypeError: Cannot read property 'removeAllListeners' of null at /usr/local/lib/node_modules/playactor/dist/remoteplay/session.js:125:16 at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/playactor/dist/remoteplay/session.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:94:5)

I believe something went wrong in the pairing process, is there a way to delete the previously made connection? Because I get the same error when running the login command, which I did not get running the command the first time.

@dhleong
Copy link
Owner

dhleong commented Apr 5, 2021 via email

@dwffls
Copy link
Author

dwffls commented Apr 5, 2021

Thanks for the quick answer!

Removed the directory, tried login in (this worked) but got the same error.

In a moment, we will attempt to open a browser window with the following URL: https://auth.api.sonyentertainmentnetwork.com/2.0/oauth/authorize?service_entity=urn:service-entity:psn&response_type=code&client_id=ba495a24-818c-472b-b12d-ff231c1b5745&redirect_uri=https://remoteplay.dl.playstation.net/remoteplay/redirect&scope=psn:clientapp&request_locale=en_US&ui=pr&service_logo=ps&layout_type=popup&smcid=remoteplay&prompt=always&PlatformPrivacyWs1=minimal& Perform login there, then, when the page shows "redirect", copy the URL from your browser's address bar and paste it here. Hit ENTER to continue URL> https://remoteplay.dl.playstation.net/remoteplay/redirect?code=my_code&cid=my_cid Registering via Remote Play. Go to Settings > System > Remote Play > Link Device Enter PIN here> my_pin

TypeError: Cannot read property 'removeAllListeners' of null at /usr/local/lib/node_modules/playactor/dist/remoteplay/session.js:125:16 at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/playactor/dist/remoteplay/session.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:94:5)

@dwffls
Copy link
Author

dwffls commented Apr 5, 2021

I just saw I got this error on an earlier attempt:

Error: Registration error: 403: Forbidden: Other Error at Object.<anonymous> (/usr/local/lib/node_modules/playactor/dist/remoteplay/protocol.js:87:19) at Generator.next (<anonymous>) at fulfilled (/usr/local/lib/node_modules/playactor/dist/remoteplay/protocol.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:94:5)

Don't know if it's helpful

@peskdale
Copy link

peskdale commented Apr 5, 2021

I am regularly getting the same removeAllListeners error, despite also regenerating my credentials JSON file.

Absolutely unsure if these are related at all... but along with these errors, I'm also having a lot of trouble getting commands other than wake to work properly at all. Most of the time, either a removeAllListeners error appears, or the command just hangs until I exit with Ctrl-C.

On the rare occasions a command exits successfully, the actual function doesn't appear to work as intended. login only seems to perform an actual login in the device is already awake. Otherwise, it only wakes the console and then either errors or hangs.

standby does nothing other than occasionally triggering a remote play notification on the console (and this is inconsistent). Otherwise, again either errors or hangs.

@dhleong
Copy link
Owner

dhleong commented Apr 12, 2021

Strange, I cannot seem to replicate the removeAllListeners error; what version of nodeJS are you all using?

@dwffls
Copy link
Author

dwffls commented Apr 12, 2021

I'm using node v15.14.0 on macOS 11.2.3.

Tried to run it on my debian server to see if it's a macOS problem. But I got this error:

URL> node:events:346
      throw er; // Unhandled 'error' event
      ^

Error: spawn xdg-open ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:480:16)
    at processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:480:16)
    at processTicksAndRejections (node:internal/process/task_queues:81:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn xdg-open',
  path: 'xdg-open',
  spawnargs: [
    'https://auth.api.sonyentertainmentnetwork.com/2.0/oauth/authorize?service_entity=urn:service-entity:psn&response_type=code&client_id=ba495a24-818c-472b-b12d-ff231c1b5745&redirect_uri=https://remoteplay.dl.playstation.net/remoteplay/redirect&scope=psn:clientapp&request_locale=en_US&ui=pr&service_logo=ps&layout_type=popup&smcid=remoteplay&prompt=always&PlatformPrivacyWs1=minimal&'
  ]
}

I believe it has something to do with opening the browser

@dhleong
Copy link
Owner

dhleong commented Apr 12, 2021

I'm using node v15.14.0 on macOS 11.2.3.

Thanks! I can reproduce it on believe I have a fix. I'll be rolling on 0.2.1 shortly.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants