With API Scripts, it can often occur if there isn't a return at the end of the file. Something like this: /* ... bunch of code ... */
} followed by: var foo = foo || (function() {
/* ... bunch of code ... */ can get concatenated into this: /* ... bunch of code ... */
}var foo = foo || (function() {
/* ... bunch of code ... */ Which is an error because it expected the end of line or ; to be there (Javascript has automatic semicolon insertion, which leads to all these and many other subtle errors...), and instead sees a v, which is an "unexpected identifier". Putting a ; at the end of your scripts, or at the beginning can cause that not to be an issue.