Typescript definition is broken
See original GitHub issueHey
- Typescript 3.0.3
- ioredis 4.0.0
Typescript definition throws an error not matter what combination of import I’m trying
import * as Redis from "ioredis";
const redis = new Redis();
error TS2351: Cannot use ‘new’ with an expression whose type lacks a call or construct signature.
When trying
import Redis from "ioredis";
const redis = new Redis();
Getting the error
TS1192: Module ‘“node_modules/@types/ioredis/index”’ has no default export.
Any ideas? thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Go to definition not working as expected when typescript ...
Go to definition not working as expected when typescript definitions are included #39215 · Given a NPM package that contains type declarations (....
Read more >How to fix broken Typescript definitions when definitions files ...
I have a project that uses Typescript, using the newer @types/foo style of installing typings packages. When my build server installs all npm ......
Read more >Code hinting partially broken in TypeScript when using .d.ts ...
I've had issues working with the DefinitelyTyped AngularJS definitions due to WebStorm not resolving module declarations like this: declare module ng.route { .....
Read more >Promise made and promise broken: TypeScript vs. real life data
Code that relies on external services is then either left to trust those services will communicate as they typed they would, or, rather...
Read more >TypeScript errors and how to fix them
A list of common TypeScript errors and how to fix them.
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
It seems that the
tsconfig.json
file didn’t have the keyallowSyntheticDefaultImports
set for true, now it’s fixedTested with 3.0.3 & 3.1.1