Closed rhythnic closed 8 years ago
Do you have lastest version of universe:modules?
Did you tied catch error in promise or in this function ?
Please change content of this function on simple 'return "test"; ' I think the problem is because You have an exception here.
I'm using Meteor 1.2.1 and modules 0.6.1 and modules compiler 1.0.2. Also, this is occurring inside of a package.
It seems like an issue with the inheritance of static getters.
// server/main.import.js
import Customer from '../lib/classes/customer'
console.log(Customer.testOne)
// undefined
console.log(Customer.testTwo)
// test two
// lib/classes/customer.import.js
import CustomerBase from './base/customer'
export default class Customer extends CustomerBase {
constructor(){}
static get testTwo() {
return 'test two';
}
}
// lib/classes/base/customer.import.js
export default class CustomerBase {
constructor(){}
static get testOne() {
return 'test one';
}
}
It works if you forward the getter like this.
// server/main.import.js
import Customer from '../lib/classes/customer'
console.log(Customer.testOne)
// test one
console.log(Customer.testTwo)
// test two
// lib/classes/customer.import.js
import CustomerBase from './base/customer'
export default class Customer extends CustomerBase {
constructor(){}
static get testOne() {
return super.testOne;
}
static get testTwo() {
return 'test two';
}
}
// lib/classes/base/customer.import.js
export default class CustomerBase {
constructor(){}
static get testOne() {
return 'test one';
}
}
Are you sure that this is related to modules and its not some strange corner case babel bug?
Does it work when you execute everything inside one file? (sorry I cannot test this myself right now)
I have tested it on the babel playground and it works, but I haven't tested it yet in the app outside of modules. I'll create a test case in a normal .js file in the app and get back to you. On Oct 28, 2015 7:51 AM, "Maciek Stasiełuk" notifications@github.com wrote:
Are you sure that this is related to modules and its not some strange corner case babel bug?
Does it work when you execute everything inside one file? (sorry I cannot test this myself right now)
— Reply to this email directly or view it on GitHub https://github.com/vazco/universe-modules/issues/33#issuecomment-151667939 .
You can also try inside both .import.js and plain .js file (with ecmascript package on), this could clear the situation. Thanks!
I just confirmed that the error happens outside of the modules package. Thanks for your help.
This might be a configuration problem on my part, but i'm using a static getter in a class definition that's not working. Static methods work, just not static getters.
... but if I remove the 'get' from the static definition, then this works.
Any ideas?