Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

fix SyntaxError: Unexpected token static when building #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix SyntaxError: Unexpected token static when building #64

wants to merge 1 commit into from

Conversation

RELNO
Copy link

@RELNO RELNO commented Jun 11, 2019

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 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

Solution

Replace variable static with staticVal where it is used

Results

Build is succesful

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant