Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Unexpected token: operator (<) (line: X, col: Y)

Avatar

Employee

I'm getting the following error:

Unexpected token: operator (<) (line: X, col: Y)

What's wrong with my code?

1 Accepted Solution

Avatar

Correct answer by
Employee

You’ve likely chosen the incorrect setup type for your script. Based on the contents of the script, the editor was expecting HTML, but you set the script to Javascript or vice versa. For example: if your script contains <script> tags, but you set the script up as Javascript, you will receive this error when you attempt to save the code.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

You’ve likely chosen the incorrect setup type for your script. Based on the contents of the script, the editor was expecting HTML, but you set the script to Javascript or vice versa. For example: if your script contains <script> tags, but you set the script up as Javascript, you will receive this error when you attempt to save the code.