Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
TS2345: Argument of type x is not assignable to parameter of type y, x is extends y

I want to run the sigma.js\examples\custom-rendering example, when I run npm start, I got TS2345: Argument of type 'Graph<Attributes, Attributes, Attributes>' is not assignable to parameter of type 'AbstractGraph<Attributes, Attributes, Attributes>'. errors.

I find the Graph type declaration is the following.

export default class Graph<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes,
  GraphAttributes extends Attributes = Attributes
> extends AbstractGraph<NodeAttributes, EdgeAttributes, GraphAttributes> {}

declare abstract class AbstractGraph<
  NodeAttributes extends Attributes = Attributes,
  EdgeAttributes extends Attributes = Attributes,
  GraphAttributes extends Attributes = Attributes
> extends EventEmitter<NodeAttributes, EdgeAttributes, GraphAttributes> { ... }

It seems typescript does not accept Graph<Attributes, Attributes, Attributes> as an AbstractGraph<Attributes, Attributes, Attributes> instance. That's different from what I have learn in Java/C#.

What's wrong with it?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!