Format Error Messages
The following table describes error messages that can result from incorrect script format. A format error message starts with the following error prefix: Syntax error at line line# position character#.
Message | Example | Cause |
---|---|---|
Expected ':' |
Example 1 Example 2 Example 3
|
A colon (:) character is required in the context but you did not provide one. To correct the error, you do the following:
|
Expected ';' |
|
A semi-colon (;) character is required in the context but you did not provide one. A semi-colon is used to end a statement. Make sure you do the following:
|
Expected '(' |
|
The open parenthesis ( ( ) and the close parenthesis ( ) ) do not pair up. |
Expected ')'. |
Not applicable |
The open parenthesis ( ( ) and the close parenthesis ( ) ) do not pair up. |
Expected ']'. |
|
The open bracket ( [ ) and the close bracket ( ] ) do not pair up. |
Expected '{'. |
|
The open brace ( { ) and the close brace ( } ) do not pair up. |
Expected '}'. |
|
The open brace ( { ) and the close curly brace ( } ) do not pair up. |
Expected identifier. |
|
A name is required in the context but you did not provide one. The name can include one of the following items:
|
Invalid token. |
|
An invalid Unicode character combination or an invalid hex character combination exists. |
Expected while. |
|
The Do While statement is not complete. A while method is required to complete the statement but you did not provide one. |
Throw must be followed by an expression on the same line. |
|
The Throw statement must be followed by a name that identifies an exception on the same line, but you did not provide an expression of this type. |
Invalid continue statement. |
|
The Continue statement is not in the body of one of the following items:
|
Invalid Break statement. |
|
The Break statement is not in the body of one of the following items:
|
Invalid return statement. Return statement cannot be used outside the function body. |
|
A Return statement exists outside the body of a function but it must exist in the body of a function. |
Invalid left-hand side value. |
|
The preceding value in an assignment operation must be compatible with the value assigned. In the example, the New Object statement is an invalid left-hand value for the equal (=) assignment operator. The valid preceding value must contain a variable. |
Invalid regular expression. |
|
The regular expression is invalid. For example, the closing bracket ( ] ) is missing. |