-
Notifications
You must be signed in to change notification settings - Fork 29
Uncaught SyntaxError: Invalid or unexpected token #4
Copy link
Copy link
Open
Description
Trying to save an APEX class with a syntax error results in no error message and failure to save. Opening the browser's javascript console shows:
Uncaught SyntaxError: Invalid or unexpected token
at Object.success (d3vCode.js?v=1.0.2:4005)
at n (jquery.min.js?v=1.0.2:2)
at Object.fireWith [as resolveWith] (jquery.min.js?v=1.0.2:2)
at w (jquery.min.js?v=1.0.2:4)
at XMLHttpRequest.d (jquery.min.js?v=1.0.2:4)
The "Network" tab of the browser's developer tools shows the actual return value from Salesforce:
{ "bodyCrc" : "","column" : "18","Id" : "","line" : "178","Name" : "AcctFinancialHistoryController","problem" : "Unrecognized symbol '"', which is not a valid Apex identifier.","success" : "false","warnings" : ""}
The actual problem in the class is that double-quotes were used around a string literal instead of single quotes. I suspect that a parser is failing to parse the error with the mixed (and unbalanced) quotation marks?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels