First of all I have to say that this question is a duplicate of Extend Global Class with Another Global Class in Coffeescript/Meteor but the answer for that one it's not working for me.
I have been trying moving files in different places with different names following the Meteor load order but I keep getting a Reference Error.
I have to files in the same folder:
//File A.js
console.log("A.js");
class A{
constructor(){
this.name = "Parent";
}
sayWho(){
console.log(this.name);
}
}
And
// File B.js
console.log("B.js")
class B extends A{
constructor(){
super();
this.name = "Child B";
}
}
The output is
A.js
B.js
ReferenceError: A is not defined
So it's obvious that A.js
loads before B.js
but still doesn't work. I can create an instance of A
in A.js
and use it in B.js
so that is more proof things are loading in the correct order.
What am I missing here?
Thanks for the help.