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? – Brandon Durham Aug 25 '13 at 22:37

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';
| improve this answer | |

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

| improve this answer | |
  • 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… – Brandon Durham Aug 22 '13 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 :) – Andris Sevcenko Aug 23 '13 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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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