Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to minify the bundle. Error: static/js/main.XXXXXX.js from UglifyJs #1623

Closed
yingapp opened this issue May 4, 2019 · 2 comments
Closed
Labels

Comments

@yingapp
Copy link

@yingapp yingapp commented May 4, 2019

Failed to minify the bundle. Error: static/js/main.XXXXXX.js from UglifyJs
Unexpected token: name (index) [static/js/main.XXXXX.js:XXXXX,5]


const c = 'color: ' + this.color;
args.splice(1, 0, c, 'color: inherit');

// The final "%c" is somewhat tricky, because there could be other
// arguments passed either before or after the %c, so we need to
// figure out the correct index to insert the CSS into

let index = 0; //XXXXX  error line


let lastC = 0;
args[0].replace(/%[a-zA-Z%]/g, match => {
	if (match === '%%') {
		return;
	}
	index++;
	if (match === '%c') {
		// We only are interested in the *last* %c
		// (the user may have provided their own)
		lastC = index;
	}
});

@stale

This comment has been minimized.

Copy link

@stale stale bot commented Aug 2, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Aug 2, 2019
@feross

This comment has been minimized.

Copy link
Member

@feross feross commented Aug 2, 2019

You need to use babel-minify or another minifier that supports modern ES syntax.

@feross feross closed this Aug 2, 2019
@stale stale bot removed the stale label Aug 2, 2019
@feross feross added the question label Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.