I've been relying on dagrejs/dagre for a while, which depends on @dagrejs/graphlib. And I have met some typing issues in the last updates.
I have discovered many inconsistencies. I suggest to use Typescript for a strong typing.
I have done a PR for this migration: #509.
It's also related to dagrejs/graphlib#224.