Definitelytyped: node_modules/@types/restify/index.d.ts(735,5): error TS2717

Created on 22 May 2018  路  5Comments  路  Source: DefinitelyTyped/DefinitelyTyped

When I try to compile with [email protected], I get this error:

node_modules/@types/restify/index.d.ts(735,5): error TS2717: Subsequent property declarations must have the same type.  Property 'headers' must be of type '() => any', but here has type 'any'.
11:25:47 - Compilation complete. Watching for file changes.

I have already tried to put types: [] in the compilerOptions, exclude node_modules, etc... but the only solution was to install [email protected].

Anyone else have also encontered this error?

Most helpful comment

I was able to reproduce this error with @types/restify 5.0.6 and restify 6.3.1
tsc version: 3.3.3333

I then upgraded @types/restify to 5.0.11 and the error went away.

See test repo https://github.com/anvad/restify-ts-test
running tsc with the initial commit of that test repo shows the error.
running tsc with the next commit of that repo shows error has gone away.

Perhaps this issue can be closed now?

All 5 comments

Can you provide more information? Which version of @types/restify and restify are you using, and what are you calling?

Sorry, follow the versions:

"restify": "6.3.4",
"@types/restify": "5.0.8"

The error occurs on calling tsc to compile.

I tried those versions (with [email protected]) in a bare project, and I don't get any errors. Have you tried deleting your node_modules and reinstalling your dependencies? error TS2717 might be the result of old types hanging around.

If that doesn't work, can you provide your tsconfig.json, and maybe your npm list? Are you setting your own types for restify anywhere in your project?

I was able to reproduce this error with @types/restify 5.0.6 and restify 6.3.1
tsc version: 3.3.3333

I then upgraded @types/restify to 5.0.11 and the error went away.

See test repo https://github.com/anvad/restify-ts-test
running tsc with the initial commit of that test repo shows the error.
running tsc with the next commit of that repo shows error has gone away.

Perhaps this issue can be closed now?

I am also experiencing this problem in response headers I am using [email protected] @ types / restify @ 5.0.6

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alisabzevari picture alisabzevari  路  3Comments

jrmcdona picture jrmcdona  路  3Comments

fasatrix picture fasatrix  路  3Comments

victor-guoyu picture victor-guoyu  路  3Comments

csharpner picture csharpner  路  3Comments