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

Viewing variables when debugging (vscode with ColdFusion Builder extension) without HTML output

New Here ,
Mar 03, 2023 Mar 03, 2023

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?

Views

326

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
New Here ,
Mar 03, 2023 Mar 03, 2023

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.

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 ,
Mar 06, 2023 Mar 06, 2023

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

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 ,
Mar 20, 2023 Mar 20, 2023

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    

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
New Here ,
Mar 20, 2023 Mar 20, 2023

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?

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 ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

LATEST

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.

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