Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invalid token '\n' found on line 31 at column 0

Tags:

coldfusion

I have a CF-7 file with 30 line of code.I am getting an error on the 31st line saying

             ** Invalid token '\n' found on line 31 at column 0.**

what does the error message mean?

Regards

Vas

like image 523
vas Avatar asked Dec 09 '22 19:12

vas


2 Answers

The error is slightly misleading. The CF compiler is trying to parse the code but failing because of a unclosed tag / block so it keeps on trying to parse until the end of the document and then it reports the error since the last thing it found was a newline which isn't closing the tag that's currently open. So go over the source code and check where you aren't properly closing something. The error is before line 31.

it could be something like

<cfif foo eq "Bar">
  Still haven't found what I'm looking for.

and then not having a closing tag. Or it could also be you have a CF style comment

<!--- but are closing it as a HTML comment -->
like image 87
olle Avatar answered Dec 27 '22 15:12

olle


There is a new line character at the beginning of the line. Is whatever you are using to parse the file is not expecting an empty line?

like image 20
Jerry Bullard Avatar answered Dec 27 '22 15:12

Jerry Bullard