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.

Typescript definition is broken

See original GitHub issue

Hey

  • 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:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KromDanielcommented, Oct 7, 2018

It seems that the tsconfig.json file didn’t have the key allowSyntheticDefaultImports set for true, now it’s fixed

0reactions
luincommented, Oct 6, 2018

Tested with 3.0.3 & 3.1.1

Read more comments on GitHub >

github_iconTop 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 >

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