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

Failing NPM run build #1

Open
ttan opened this issue Feb 1, 2021 · 0 comments
Open

Failing NPM run build #1

ttan opened this issue Feb 1, 2021 · 0 comments
Labels
question Further information is requested

Comments

@ttan
Copy link

ttan commented Feb 1, 2021

Hi! I was planning to expand the job you've done since I'm using some devices that will only work via Tuya Cloud API. I'm currently using a mini Nodejs server to poll them and rewrite easier API for HB Http plugin. It's the first time I'm dealing with developing a new plugin so I apologies!

I'm planning to expand it to switches and RBG Lights. Happy to contribute if I make it after this issue :)

Describe Your Problem:
during installation, npm run build fails.

Logs:

> homebridge-plugin-tuyacloud@1.0.0 build /Users/tommasotani/Downloads/homebridge-tuya-cloud-master
> rimraf ./dist && tsc

src/platform.ts:53:76 - error TS2345: Argument of type 'unknown' is not assignable to parameter of type 'string'.

53     let sign = this.calc_sign(this.config.clientID + this.accessToken + t, this.config.secret);
                                                                              ~~~~~~~~~~~~~~~~~~

src/platform.ts:65:12 - error TS2769: No overload matches this call.
  Overload 1 of 2, '(config: AxiosRequestConfig): AxiosPromise<any>', gave the following error.
    Type 'unknown' is not assignable to type 'string | undefined'.
      Type 'unknown' is not assignable to type 'string'.
  Overload 2 of 2, '(url: string, config?: AxiosRequestConfig | undefined): AxiosPromise<any>', gave the following error.
    Argument of type '{ headers: { client_id: unknown; sign: string; t: string; sign_method: string; }; url: string; baseURL: unknown; params: any; data: string; method: string; }' is not assignable to parameter of type 'string'.

 65     return axios({
               ~~~~~~~
 66       headers: headers,
    ~~~~~~~~~~~~~~~~~~~~~~~
...
 71       method: "GET"
    ~~~~~~~~~~~~~~~~~~~
 72     });
    ~~~~~~

  node_modules/axios/index.d.ts:47:3
    47   baseURL?: string;
         ~~~~~~~
    The expected type comes from property 'baseURL' which is declared here on type 'AxiosRequestConfig'

src/platform.ts:131:26 - error TS2571: Object is of type 'unknown'.

131     for (const device of this.config.deviceList) {
                             ~~~~~~~~~~~~~~~~~~~~~~

  • Node.js Version: v12.18.2
  • NPM Version: 6.14.10
  • Operating System: macOS
@ttan ttan added the question Further information is requested label Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant