Page 1 of 1
First production build - JS errors around let-statements
Posted: 07 July 2020, 00:05
by Brainchild
I'm getting this error when I try a production build for my game:
On a line like this, for example:
I've determined it doesn't like the
let keyword. If I change it to
var it compiles fine. I thought maybe production is not supporting Javascript ECMAScript 6, but I'm able to use
const, which I believe was also introduced in ES6.
Re: First production build - JS errors around let-statements
Posted: 07 July 2020, 00:11
by Tisaac
My advice : run babeljs (
https://babeljs.io/) on your code and pick ECMA5 to be sure that it will pass shrinksafe (you can also download the shrinksafe version used on BGA to check before deployment).
Too bad we are not allowed to use ECMA6 with arrow-function (solved so many scoping issue)...
Re: First production build - JS errors around let-statements
Posted: 07 July 2020, 07:52
by JumpMaybe
This is mentioned in the docs:
http://en.doc.boardgamearena.com/Game_i ... amename.js
Section: ShrinkSafe minimization
There it mentions ECMAScript 3 (1999) as the cut-off..
But Brainchild is right about const being introduced in ES6 so why is that working...
Re: First production build - JS errors around let-statements
Posted: 07 July 2020, 08:09
by Een
JumpMaybe wrote: ↑07 July 2020, 07:52
But Brainchild is right about const being introduced in ES6 so why is that working...
As far as I know, it does'nt.