rweich/streamdeck-ts

AbstractStreamdeckConnector.js:131 Error: error while validating payload: must be <= 1 payload

Closed this issue · 2 comments

Hey!

I'm creating a plugin with multiple actions. After I added the second action, I noticed that I get random errors when pressing keys.

AbstractStreamdeckConnector.js:131 Error: error while validating payload: must be <= 1 payload: {"action":"dev.com.fnando.sd-yt.live-chat","context":"40D49F56F0E322597CCF8E2D9EA37916","device":"8950643F1953C3E156AD0519A8B5344B","event":"keyUp","payload":{"coordinates":{"column":2,"row":2},"isInMultiAction":false,"settings":{},"state":2}}
    at assertType (AssertType.js:14)
    at KeyUpEvent.assertType (AbstractReceivedBaseEvent.js:13)
    at new AbstractReceivedBaseEvent (AbstractReceivedBaseEvent.js:9)
    at new AbstractReceivedContextEvent (AbstractReceivedContextEvent.js:7)
    at new AbstractReceivedExtendedEvent (AbstractReceivedExtendedEvent.js:7)
    at new AbstractKeyEvent (AbstractKeyEvent.js:7)
    at new KeyUpEvent (KeyUpEvent.js:11)
    at EventFactory.createByEventPayload (EventFactory.js:42)
    at EventsReceived.createFromPayload (EventsReceived.js:9)
    at Plugin.createByMessageEvent (AbstractStreamdeckConnector.js:146)

This event, keyUp, is not something I'm listening; instead, I'm subscribing to willAppear and keyDown.

Source code is available at https://github.com/fnando/streamdeck-youtube-tools

PS: Thanks for this awesome project. Developing with is much nicer dev experience.

Hi!

thanks for reporting! Always love a good description and sample code 🧡

The fix is easy, but (right now) it's planned to be on a new major version. I'll try to get it out on the weekend.

As you're using v2 of this package - are you able to upgrade to v3 and are you using node v14.17 or greater?

Updating to v4 should fix the issue. Drop me a note if it doesn't.