简体   繁体   中英

How do I debug Uglify parse errors?

I'm uglifying a JS file and just started getting

DEBUG: { message: 'Unexpected token: name (a)',
  line: 1,
  col: 17726,
  pos: 17726

What are the debugging steps I need to follow to track this down?

Needless to say, I've tried the obvious stuff like searching for "name" and "(a)", neither of which appear in the file. It would also be helpful to see what "line:1 col: 17726" are referring to since my input file is beautiful JS.

Turns out the problem was the final line of one of the files didn't end with a CR. Thus, it and the first line on the following file were being concatenated into a single line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM