I go into the Assets add-on, then to "Update Indexes," select my image group and hit the "Update Indexes" button and get an immediate JS error:

Uncaught SyntaxError: Unexpected token < assets.min.js?2.1.4:10

Is this a known issue? Any suggestions how to fix?

The error is here:

enter image description here

  • @Daniele — Mind adding that as an answer so I can mark it as correct? Commented Aug 25, 2013 at 22:37

3 Answers 3


as suggested here : Assets2 borked after removing index.php (official Ellislab method)

you should add this line to your config.php file

$config['assets_site_url'] = '/index.php';

what is the response you're getting? Probably not a valid JSON response and has some PHP errors preceding it, which would cause this.

  • Hi Andris. Not sure how to get any response other than this error. As far as I can find nobody else has reported this issue, so it makes me wonder if there is a conflict with another plugin… Commented Aug 22, 2013 at 14:23
  • Brandon, in the Chrome Developer tools select the "Network" and then click Update Indexes. You should see a request being made. Click on that request and then click on the "Response" tab for that request. Presto Also, a common cause for these sort of things is a missing trailing slash in Server Path for upload folder settings, so you might want to check that before doing this :) Commented Aug 23, 2013 at 6:07

I understand that this thread is a few years old but this one caught me out when trying to use Assets on my local machine recently when doing a new site.

Assets will not work if you have debug turned on - $debug = 1 in your index.php file and you have php errors (unrelated)

Having debug turned on results in the same 'Unexpected Token' JavaScript error that the OP had.

When checking the Network tab in Chrome Dev Tools, the request made when clicking the Update Indexes button resulted in the php errors being returned in the response

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.