Type definitions overshadowing
See original GitHub issueTypeScript 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:
- Created 4 years ago
- Reactions:1
- Comments:14 (6 by maintainers)
Top 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 >
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 Free
Top 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
@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?
@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.