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

146
Views
NodeJS Parent-Child classes over multiple files

Coming from C# it is easily possible to have 2 classes, from separate files, referring to each other in a circular relationship. However now in (Node) JS, it appears to be causing issues.

The idea is that I have the following scenario:

// Parent.js
import {Child} from './Child.js'

export class Parent {
  /** @type {Child} */
  child
}
// Child.js
import {Parent} from './Parent.js'

export class Child {
  /** @type {Parent} */
  parent
}

Is it possible to retain this relationship, without merging the two files together, and resolve the circular dependency?

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!