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.

Type definitions overshadowing

See original GitHub issue

TypeScript Version: 3.8.3

(also tried 3.9.0-dev.20200310)

Search Terms: “Module ‘“immutable”’ has no exported member”

Code

(not self contained)

import { hash } from "immutable";

export function test(): number {
    return hash(1);
}

Actual behavior:

src/index.ts:1:10 - error TS2305: Module '"immutable"' has no exported member 'hash'.

1 import { hash } from "immutable";
           ~~~~

even though grep "export function hash" node_modules/immutable/dist/immutable.d.ts reveals export function hash(value: any): number;

Because it uses type definitions in node_modules/@types/draft-js/node_modules/immutable/dist/immutable.d.ts instead of node_modules/immutable/dist/immutable.d.ts

Demo:

sadly I did not find any way to put it in a playground, in any case: https://gitlab.com/rawieo/issue_demo_1

Related Issues:

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RyanCavanaughcommented, Mar 19, 2020

@sheetalkamat I think we need something that would allow this to not happen, even if it’s not feasible to make it work out-of-the-box. Any ideas?

0reactions
Rawieocommented, Aug 4, 2020

@FilipMessa no, sadly I had no luck searching for solution in user-space. I was considering fixing the compiler myself, but I have no idea how so I didn’t even try.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overshadowing definition | Psychology Glossary - AlleyDog.com
Overshadowing is when two or more more stimuli are present, and one stimulus produces a stronger response than the other because it is...
Read more >
overshadowing - APA Dictionary of Psychology
n. in classical conditioning, a decrease in conditioning with one conditioned stimulus because of the presence of another conditioned stimulus. Usually a ...
Read more >
types/draft-js type definitions overshadows immutable-js's type ...
in typescript project (e.g. yarn create react-app --typescript x ); install draft-js , @types/draft-js , immutable; try import { hash } from ...
Read more >
Overshadowing - Study Notes ABA
Overshadowing. This occurs when there is a competing stimulus in the environment that prevents an individual from acquiring a skill.
Read more >
Overshadow definition and meaning | Collins English Dictionary
If an unpleasant event or feeling overshadows something, it makes it less happy or enjoyable. Fears for the President's safety could overshadow his...
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