Open RELNO opened 5 years ago
Upon packing for production (using parcel.js/webpack) an error occurred: SyntaxError: Unexpected token static
SyntaxError: Unexpected token static
This error is caused since the word static is misinterpreted by terser optimization module during build for prod (but won't raise during testing). See: https://medium.com/@omril321/fixing-overly-aggressive-optimization-with-terser-f07309761b50 Probably due to static methods changeing in ES6/7
static
terser
Replace variable static with staticVal where it is used
staticVal
Build is succesful
Problem
Upon packing for production (using parcel.js/webpack) an error occurred:
SyntaxError: Unexpected token static
Description
This error is caused since the word
static
is misinterpreted byterser
optimization module during build for prod (but won't raise during testing). See: https://medium.com/@omril321/fixing-overly-aggressive-optimization-with-terser-f07309761b50 Probably due to static methods changeing in ES6/7Solution
Replace variable
static
withstaticVal
where it is usedResults
Build is succesful