In my project I'm using 2 external libraries (G6 and dagre.js) that themselves or inside dependencies share the same module declaration name dagre.
While working on the code and compiling, after
import { graphlib } from "dagre";
my TypeScript is referencing the wrong one - dagre-compound (that is a dep of @antv/g6) and not @types/dagre.
So I have this error coming out
Argument of type '{ width: number; height: number; }' is not assignable to parameter of type 'GraphOptions'.
The problem started to appear after updating node v12->v16 and TypeScript v3.9.9 -> v.4.6
Check out the sandbox with reproduction of the issue.
https://codesandbox.io/s/imports-conflict-g6-dagre-pxmy7s
Is there a way to resolve this conflict?