vue-chat-scroll: UglifyJs Unexpected Token >

After importing vue-chat-scroll, uglifyjs fails in webpack with the following error:

ERROR in js/vendor.3b917c2.js from UglifyJs
SyntaxError: Unexpected token: operator (>) [js/vendor.3b917c2.js:202508,27]

It still runs properly, but it’s not able to process it, resulting in huge file sizes.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 21 (11 by maintainers)

Most upvoted comments

Yeah I saw that about UglifyJS but it seems the “solution” most people accept is transpiling first. I’m not very frontend-savvy but it seems like a major pain in the butt.

Thanks again for the workaround!

Yes, sorry 1.0.4

Yes, I have identified the problem. Basically, UglifyJS cannot work with ECMAScript 6. If the code passes through babel and gets processed into ECMAScript 5 first then UglifyJS should have no issue processing it. I’ll try changing the code to be ECMAScript 5 compliant and see if that fixes the issue…

My webpack config has a number of files, so I’ll set up a test repo for you to make it easier, I’ll add another comment w/ link when it’s ready