question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'sigBytes' of undefined

See original GitHub issue

Homebridge shows the following error at startup:

[4/30/2021, 4:20:47 PM] Homebridge v1.3.4 (TuyaPlatform) is running on port 46922. (node:5719) UnhandledPromiseRejectionWarning: TypeError: Cannot read property ‘sigBytes’ of undefined at new init (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/crypto-js/hmac.js:53:22) at Object.HmacSHA256 (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/crypto-js/core.js:781:25) at TuyaOpenAPI._getSign (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyaopenapi.js:196:23) at TuyaOpenAPI.request (/usr/local/lib/node_modules/homebridge-tuya-platform/lib/tuyaopenapi.js:162:20) (Use node --trace-warnings ... to show where the warning was created) (node:5719) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:5719) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

What can be the cause?

This is in the configuration file of Homebridge:

    {
        "platform": "TuyaPlatform",
        "name": "TuyaPlatform",
        "options": {
            "username": "myemail@gmail.com",
            "password": "mypasswordatiot",
            "accessid": "myaccessid",
            "accesskey": "myaccesskey",
            "lang": "en",
            "endPoint": "https://openapi.tuyaeu.com"
        },
        "_bridge": {
            "username": "0E:13:79:69:3C:4B",
            "port": 46922
        }
    }

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gijssenhcommented, May 6, 2021

Thanks, now I changed it to “accessKey” with a capital “K”, but now I get the following error:

[5/6/2021, 8:59:45 AM] [TuyaPlatform] Initializing TuyaPlatform… TuyaOpenAPI request: method = post, endpoint = https://openapi.tuyaeu.com, path = /v1.0/iot-03/users/login, params = null, body = {“username”:“gijssenh@gmail.com”,“password”:“a91c1fc03db06d55f38aad73b1ddeda2beaeb4587ab5a98b4d006beb943d8cb7”}, headers = {“t”:“1620284385869”,“sign”:“7EADF962A1405A618D0866842969AB779AC5B0CA74AE4C7CC9E2F17CEDAD3E6C”,“sign_method”:“HMAC-SHA256”,“access_token”:“”,“lang”:“en”,“dev_lang”:“javascript”,“dev_channel”:“homebridge”,“dev_version”:“1.0.7”} Starting to advertise ‘TuyaPlatform 3929’ using bonjour-hap backend! [5/6/2021, 8:59:46 AM] Homebridge v1.3.4 (TuyaPlatform) is running on port 46922. (node:5828) UnhandledPromiseRejectionWarning: TypeError [ERR_HTTP_INVALID_HEADER_VALUE]: Invalid value “undefined” for header “client_id” at ClientRequest.setHeader (_http_outgoing.js:561:3) at new ClientRequest (_http_client.js:251:14) at Object.request (https.js:313:10) at RedirectableRequest._performRequest (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/follow-redirects/index.js:269:24) at new RedirectableRequest (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/follow-redirects/index.js:61:8) at Object.request (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/follow-redirects/index.js:460:14) at dispatchHttpRequest (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/axios/lib/adapters/http.js:195:25) at new Promise (<anonymous>) at httpAdapter (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/axios/lib/adapters/http.js:46:10) at dispatchRequest (/usr/local/lib/node_modules/homebridge-tuya-platform/node_modules/axios/lib/core/dispatchRequest.js:52:10) (Use node --trace-warnings ... to show where the warning was created) (node:5828) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 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(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3) (node:5828) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. [ Sorry for the many questions (I am an ‘old’ newbee of 62 😃 )

0reactions
Hanh94commented, May 6, 2021

changed it to “accessId” with a capital “I”

Read more comments on GitHub >

github_iconTop Results From Across the Web

"TypeError: Cannot read property 'sigBytes' of undefined" error ...
I'm getting "TypeError: Cannot read property 'sigBytes' of undefined" error when running a postman collection with a cryptojs pre-request ...
Read more >
Cannot read property 'sigBytes' of undefined · Issue #85 - GitHub
TypeError : Cannot read property 'sigBytes' of undefined at Object.init (/Volumes/T3/node_web/myapp/node_modules/crypto-js/hmac.js:53:21)
Read more >
Test Postman collection First test - Forum
I am getting a similar issue. There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'sigBytes' of undefined.
Read more >
Cannot read property 'sigBytes' of undefined - Bountysource
Cannot read property 'sigBytes' of undefined. TypeError: Cannot read property 'sigBytes' of undefined
Read more >
There was an error in evaluating the Pre-request Script
I am getting an error, “There was an error in evaluating the Pre-request Script: TypeError: Cannot read property 'shift' of undefined”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found