• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Invalid CFML structure found

Community Beginner ,
Feb 01, 2023 Feb 01, 2023

Copy link to clipboard

Copied

I'm getting the error "Invalid CFML structure found on line 10019 at column 34."
I know the code at line 10019 (in cfscript) has no problem.
When adding a new line (by enter key at anywhere before the error line) it still gives an error at line 10020,
but when adding one more new line it's OK.
What is the cause?
I have tried several different things like:
add or delete any comment or cftag it's OK.
(or remove a space then OK, but adding a space then gives an error ※after a little modification)
※any modifications after the error line(10019) is not efficient
I use ColdFusion2018 update15, pageEncoding="SJIS".

Views

502

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Feb 17, 2023 Feb 17, 2023

Sorry for late.

Charlie Arehart,
The code runs OK at cffiddle.org with both CF2021 and CF2018.
I use Visual Studio Code on Windows 10, ColdFusion2018 update15.
(Same error on both Windows and Linux)

 

BKBK,
I checked the code according to your sample, It doesn't have that character chr(65279).

 

Now, this problem has been solved (rearrange content), I'm closing this conversation.
Thank you for your help!

--

The cause seems to be the following complex factors:
・The file size is very large, and the number of c

...

Votes

Translate

Translate
Community Beginner ,
Feb 02, 2023 Feb 02, 2023

Copy link to clipboard

Copied

I add information: if change the newline code to LF, it's OK, but if return to CRLF, it's error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 06, 2023 Feb 06, 2023

Copy link to clipboard

Copied

Specifically the following error is occurring.
"Invalid CFML construct found on line 10 at column 6"

 1     <cfscript>
 2     someArray = [
 3         {name="testemployee", age="32"},
 4         {name="employeetest", age="36"}
 5     ];
 6     arraySort(
 7         someArray,
 8         function (e1, e2){
 9             return compare(e1.name, e2.name);
10         }
11     );
12     </cfscript>


After I fix it as follows, the error does not occur.
Fix that there is no line break between line 8 and line 9

 1     <cfscript>
 2     someArray = [
 3         {name="testemployee", age="32"},
 4         {name="employeetest", age="36"}
 5     ];
 6     arraySort(
 7         someArray,
 8         function (e1, e2){return compare(e1.name, e2.name);
 9         }
10     );
11     </cfscript>

I can't identify the cause, can anyone help me?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 06, 2023 Feb 06, 2023

Copy link to clipboard

Copied

Truong, whatever is happening for you, it's unique to you. I can run that exact same code, either way, on CF2021 or 2018 (or 2016 or 11 or 10), without any such error. (And anyone who wants to can also run it online via Adobe's CFFiddle. org, where I offer both variants (your first and second).

 

So first, before we explore your own situation any further, can you confirm if you run that code (at cffiddle.org) that it DOES run for you? Note that it has an option to change it between CF2021 and 2016. You've not said what version of CF you're running: if it may be CF2016 or 11 or 10, the code can be run against those as well (and Lucee and Railo) at trycf.com.)

 

Second, as for your end, you referred in your first note to a difference in doing a CR vs a CRLF. So what editor are you using? And on what OS? And if the problem remains, please tell us both exacly what CF version you're running and what update it's at (indicated in the CF Admin "settings summary", or in a cfdump of the server scope).


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2023 Feb 08, 2023

Copy link to clipboard

Copied

Perhaps the code that is giving the error contains an invalid, invisible character. Think, for example, of a byte-order-mark. That is, the character chr(65279).

 

There is a way to verify this:

  1. Turn an exact copy of the code into a string variable, s1.
  2. Obtain a copy of the string after byte-order-marks have been removed, s2. 
  3.  Compare the lengths of s1 and s2.

 

If the code contains a byte-order-mark, then the length of s2 will be greater than that of s1.

 

<!--- Sample code--->

 <cfscript>
 originalCode='someArray = [
     {name="testemployee", age="32"},
     {name="employeetest", age="36"}
 ];
 arraySort(
     someArray,
     function (e1, e2){
         return compare(e1.name, e2.name);
     }    
 );';
 
 codeAfterByteOrderMarkRemoved=replace(originalCode, chr(65279), "", "all");
 
 writeoutput("Length of original code = " & len(originalCode) & "<p>");
 writeoutput("Length of code after removal of byte-order-mark = " & len(codeAfterByteOrderMarkRemoved));

 </cfscript>

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 16, 2023 Feb 16, 2023

Copy link to clipboard

Copied

@Truong28204212p9a3 , any update on this?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

Sorry for late.

Charlie Arehart,
The code runs OK at cffiddle.org with both CF2021 and CF2018.
I use Visual Studio Code on Windows 10, ColdFusion2018 update15.
(Same error on both Windows and Linux)

 

BKBK,
I checked the code according to your sample, It doesn't have that character chr(65279).

 

Now, this problem has been solved (rearrange content), I'm closing this conversation.
Thank you for your help!

--

The cause seems to be the following complex factors:
・The file size is very large, and the number of class files are generated (maybe occur at compile time).
・Some contain are mixed with both CF tag descriptions and <cfscript> descriptions.
・The description location of error maybe refer to the accidental error value.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2023 Feb 17, 2023

Copy link to clipboard

Copied

Glad you solved your first problem, with the huge file. Yes, those can be trouble. (Splitting it with a cfinclude may help, if it happens again.)

 

But then it seemed you'd raised a second problem, on Feb 6 above, with just a 12-line sample. That's what my reply focused on. You confirm now that works on cfiddle: is it working now for you locally? If so, what got it working? Or why is it no longer am issue? 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

LATEST

Regarding the 12 line samples, it is the same problem (not 2 problems, sorry for misleading), it is the location where the error message is displayed (※The description location of error maybe refer to the accidental error value).
I just rearranged the content like you suggested (Splitting it with a cfinclude)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation