I reduced the issue to this simple bit of code:
class X {
static a = 5;
}
I don't know why this is a problem. It seems to be valid code. Any ideas?

Response from Google:
Apps Script V8 runtime supports EMCA2015 standards which mean static class properties are not supported at the moment. There are two workarounds available:
1 - Assign the property to the class:
// Caused an error
class MyClass {
static a = 1;
}
// ECMA2015 compatible
class MyClass {}
MyClass.a = 1;
2 - Develop the Apps Scripts with Clasp: https://github.com/google/clasp which also supports TypeScript and many other new features.
Full details are in this ticket.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With