Title: Error removing javascript comments
Last modified: September 26, 2019

---

# Error removing javascript comments

 *  Resolved [Samuel](https://wordpress.org/support/users/martdsam/)
 * (@martdsam)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/)
 * In the settings panel on the optimization tab.
 * At the bottom of the page you have the option remove comments. This option is
   removing non-commenting code and causing error when combining js files.
 * I use the axios library and there is the following code:
 * ‘Accept’: ‘application/json, text/plain, */*’
 * I use gulp to minify and remove comments, so the final code looks like this:
 * Accept: “application/json, text/plain, */*”
 * After enabling the option to remove comments from lightspeed cache it looks like
   this:
 * Accept: “application/json, text/plain, *
 * Giving this error in the browser console:
 * Uncaught SyntaxError: Invalid or unexpected token
    -  This topic was modified 6 years, 10 months ago by [Samuel](https://wordpress.org/support/users/martdsam/).

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * (@stanleylitespeed)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11972709)
 * Hi [@martdsam](https://wordpress.org/support/users/martdsam/), we tried with 
   a js file like:
 * `var test_crash = {Accept: "application/json, text/plain, */*"}`
 * but cannot reproduce the bug. Can you send us your JS file for testing?
 *  Thread Starter [Samuel](https://wordpress.org/support/users/martdsam/)
 * (@martdsam)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11972752)
 * [https://azambujamais.com.br/min/7fd86.js](https://azambujamais.com.br/min/7fd86.js)
 * I have this one from the online site. But this is minified, it will be difficult
   to find the line of code if you need.
 * I can send an uncompressed version. But I will need an email to send.
 *  [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * (@stanleylitespeed)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11974491)
 * Hi [@martdsam](https://wordpress.org/support/users/martdsam/), yes we need the
   uncompressed one, please contact us by [joining our Slack channel](https://goo.gl/FG9S4N)
   or [submiting a ticket here](https://store.litespeedtech.com/store/submitticket.php).
 *  Thread Starter [Samuel](https://wordpress.org/support/users/martdsam/)
 * (@martdsam)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11975109)
 * Ticket Created #426342
 *  [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * (@stanleylitespeed)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11986184)
 * We will update our Remove Comments feature after v3.0, if anyone’s JS file contains
   the following code (start and close comment symbol in the string) please turn
   OFF **Remove Comments** function at this moment.
 *     ```
       var a = { Accept: "application/json, text/plain, */*", ... }
       var b = { Accept: "application/json, text/plain, */*", ... }
       ```
   

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error removing javascript comments’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [stanley@litespeed](https://wordpress.org/support/users/stanleylitespeed/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/error-removing-javascript-comments/#post-11986184)
 * Status: resolved