Title: Javascript exception: Uncaught syntax error
Last modified: March 29, 2023

---

# Javascript exception: Uncaught syntax error

 *  [nyrup](https://wordpress.org/support/users/nyrup/)
 * (@nyrup)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/javascript-exception-uncaught-syntax-error/)
 * The block didn’t display and I got the following script related message in the
   Chrome console:
 * VM28360:1 Uncaught SyntaxError: Bad control character in string literal in JSON
   at position 671
   at JSON.parse ()at m (wpp.min.js?ver=6.1.1:5:497)at HTMLDocument.(
   wpp.min.js?ver=6.1.1:7:19)
 * The problem is related to newlines in the JSON encoded strings. It can be fixed
   by replacing newlines by \\n in wpp.min.js:
 * JSON.parse(c.textContent**.replaceAll(“\n”,”\\n”)**)
    -  This topic was modified 3 years, 2 months ago by [nyrup](https://wordpress.org/support/users/nyrup/).
    -  This topic was modified 3 years, 2 months ago by [nyrup](https://wordpress.org/support/users/nyrup/).

Viewing 1 replies (of 1 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/javascript-exception-uncaught-syntax-error/#post-16607393)
 * Hi [@nyrup](https://wordpress.org/support/users/nyrup/),
 * How can I reproduce this issue? I’d rather fix the root cause of the problem 
   instead of the symptoms if possible.
    -  This reply was modified 3 years, 2 months ago by [Hector Cabrera](https://wordpress.org/support/users/hcabrera/).

Viewing 1 replies (of 1 total)

The topic ‘Javascript exception: Uncaught syntax error’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/javascript-exception-uncaught-syntax-error/#post-16607393)
 * Status: not a support question