Uncaught SyntaxError: Unexpected token

#1

Hi - I keep getting this Error on my homepage. Not sure how to cure it?

Does it have something to do with loading the Facebook pixel maybe?

my homepage is www.tansleyphotography.co.uk

VM103:1 Uncaught SyntaxError: Unexpected token <
at t.activateScript (rocket-loader.min.js:1)
at rocket-loader.min.js:1
at t.run (rocket-loader.min.js:1)
at rocket-loader.min.js:1
at HTMLScriptElement. (rocket-loader.min.js:1)

0 Likes

#2

Have you checked if all your HTML, CSS, and JavaScript is valid? If it is not there is a good chance Rocket Loader will fail to load because of that. Either fix these issues or disable Rocket Loader in the control panel.

0 Likes

#3

Hi Sandro. I’m not sure how I could check if the HTML, CSS or Javascript is valid?

Sorry, I know a little bit about making websites, but my full knowledge is limited.

0 Likes

#4

https://validator.w3.org/nu/?doc=https%3A%2F%2Fwww.tansleyphotography.co.uk%2F lists quite a few issues.

0 Likes

#5

Thx Sandro. So, let me get this right. Rocket Loader isn’t actually loading - and that’s what the original syntax error is saying? And the reason it’s not loading is because of all the tiny errors I’m seeing by running that validator.

So choice is - fix those tiny error (no idea how). Or simply turn off Rocket Loader (which in theory, makes no difference, since it’s not running at the moment, as it just throws up an error).

Is that right?

0 Likes

#6

Rocket Loader appears to be loading, however it then cant parse your site for some reason.

The easiest approach might be to disable Rocket Loader at this point. If you still want to use it you should first make sure the site has a valid syntax.

0 Likes

#7

I removed this Javascript - which was in Custom JS in ProPhoto 7. This appears to have removed the error. I think this was in there, so that I could have a Facebook Like button on the site. But I’ve been gradually removing that function anyway, so probably don’t need this JS.

0 Likes