Property 'default' does not exist on type 'SuperAgentStatic'
See original GitHub issueI 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:
- Created 4 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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.No updates from my side sadly. Have you tried what tgilland95 suggested above?