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.

Property 'default' does not exist on type 'SuperAgentStatic'

See original GitHub issue

I generated some code, and it fails the Typescript build with

Property 'default' does not exist on type 'SuperAgentStatic'

The code in question is

    const agent = this.configureAgentHandler ?
        this.configureAgentHandler(request.default) :
        request.default;

It seems that the default property doesn’t exist according to @types/superagent.

At first glance this issue seems to have been introduced by this change. I can’t find a related issue or any other context on that change, but it’s clearly a deliberate change that fixed some other problem.

I’m using Superagent v5.1.0 and @types/superagent v4.1.3.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
tgilland95commented, Apr 16, 2020

@here I’ve had this issue before and for me what resolves it is adjusting compiler options in the tsconfig. This may not solve it for everyone, but adding "esModuleInterop": true fixes my error.

0reactions
mtennoecommented, Sep 23, 2020

No updates from my side sadly. Have you tried what tgilland95 suggested above?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error TS2339: Property 'default' does not exist on type 'Special[]'
The error is correct, because there is no default on Special[] . One easy way to do what you are trying to do...
Read more >
swagger-typescript-codegen-cli - npm package - Snyk
Version 3.0.1 of swagger-typescript-codegen has a critical bug: Property 'default' does not exist on type 'SuperAgentStatic' #98.
Read more >
property 'contains' does not exist on type 'never'. - You.com
when I try to convert this js to typescript I am getting some errors. The first one is for the event. It says:...
Read more >
Typescript Type System: How Does it Really Work? Type ...
Error:(54, 6) TS2339:Property 'name' does not exist on type '{}'. So what is going here? We have defined an empty object first and...
Read more >
@types/superagent@4.1.15 - jsDocs.io
Documentation for npm package @types/superagent@4.1.15 - jsDocs.io.
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