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

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

Open
jthemphill opened this issue Nov 8, 2024 · 0 comments · May be fixed by #347
Open

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

jthemphill opened this issue Nov 8, 2024 · 0 comments · May be fixed by #347

Comments

@jthemphill
Copy link

jthemphill commented Nov 8, 2024

Upgrading from 4.3.0 to 5.1.1 broke our typechecking. Code like this

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 #310 (comment)

@43081j 43081j linked a pull request Nov 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant