ITADN

TypeScript errors: `Property 'post' does not exist on type 'Agent'`

#346Closedjthemphill 创建于 2024-11-08
J
jthemphillcommented
Upgrading from `4.3.0` to `5.1.1` broke our typechecking. Code like this ```ts chai.request .agent(this._server) .post('/api/preview') ``` now fails with this error: ``` error TS2339: Property 'post' does not exist on type 'Agent'. ``` We think it's because `@types/superagent` is now in `devDependencies`, instead of `dependencies`. I think it should be in `dependencies`, because your package exports `superagent` types publicly. Since the superagent types are part of your public types, any package which uses your types should also include the `superagent` types that you export. _Originally posted by @jthemphill in https://github.com/chaijs/chai-http/pull/310#discussion_r1833573576_
关闭于 2024-11-19 0 条评论