I found that getting Unexpected } was because a piece of my code used the php short tag <? instead of <?php - took me a while to find this one as it worked on other servers.
I'm getting the Uncaught SyntaxError: Unexpected string error in my JavaScript and I honestly can't figure out what's wrong with the code. I have looked at the similar questions, but I'm unable to find a solution.