Copy link to clipboard
Copied
Hello.
It seems that to be able to view variables when debugging, I have to turn on Enable Request Debugging Output, which causes a whole bunch of information to be appended to the returned HTML.
If a whole bunch of HTML is returned in each response, the application I'm debugging doesn't really work, as it expects a certain kind of output (basic strings or xml) and the extra HTML messes that up.
How can I view variables while debugging, but not get all of that extra HTML that breaks the application?
Copy link to clipboard
Copied
I'm also getting these errors when trying to inspect variables in vscode:
589 :: Error on parsing server response
Error on variablesRequest
It seems to work fine in ColdFusion Builder, though the issue with the HTML output is the same of course.
Copy link to clipboard
Copied
I'm not sure if this is still in CF, but there used to be a way you could specify the request debugging output go to a new browser window instead of the existing browser window.
Dave Watts, Eidolon LLC
Copy link to clipboard
Copied
Use <cflog> or <cfdump> to write the XML response to file. For example:
<cfsavecontent variable="xmlResult" >
<?xml version="1.0" encoding="utf-8"?>
<note>
<to>Jack</to>
<from>Jim</from>
<heading>Reminder</heading>
<body>Don't forget this weekend!</body>
</note>
</cfsavecontent>
<cflog text="#xmlResult#" file="xmlResult">
<cfdump var="#xmlResult#" format="text" output="#getDirectoryFromPath(getCurrentTemplatePath())#result.xml">
That code will write the XML content to a log file and to a file (result.xml) in the current directory.
Nevertheless, <cfdump format="text"> seems to have a bug in ColdFusion 2021. It appends a line containing asterisks ***... to the output. I have reported it: https://tracker.adobe.com/#/view/CF-4217397
Copy link to clipboard
Copied
I'm not quite getting how this will fix the issue.
Would cfdump return the file contents to the client?
Does that break viewing variables in the debugger?
And it also looks like this is something I'd have to do this in every file that's a target of an AJAX call?
Copy link to clipboard
Copied
My suggestion is not meant as a fix for the issue. It is instead a workaround.
It enables you to view the XML result separately from the debug output.