<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How Can I Debug Jsereport in Visual Studio Code?? Thanks!!]]></title><description><![CDATA[<p>I'm trying debugging Jsreport using Visual Studio Code. Please I need help. Thanks.</p>
<p>Note: I'm trying something like this...<br />
<img src="/uploads/files/1491316233590-upload-a3b2ef69-f191-49ee-b763-d7b69accece1.png" alt="0_1491316232018_upload-a3b2ef69-f191-49ee-b763-d7b69accece1" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.jsreport.net/topic/47/how-can-i-debug-jsereport-in-visual-studio-code-thanks</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Mar 2026 03:23:51 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/47.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Apr 2017 14:33:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>I'm trying debugging Jsreport using Visual Studio Code. Please I need help. Thanks.</p>
<p>Note: I'm trying something like this...<br />
<img src="/uploads/files/1491316233590-upload-a3b2ef69-f191-49ee-b763-d7b69accece1.png" alt="0_1491316232018_upload-a3b2ef69-f191-49ee-b763-d7b69accece1" class="img-responsive img-markdown" /></p>
]]></description><link>https://forum.jsreport.net/post/176</link><guid isPermaLink="true">https://forum.jsreport.net/post/176</guid><dc:creator><![CDATA[rober]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>Debugging jsreport seems to work fine for me. Just open in vscode the folder with application.</p>
<p>Have something similiar in <code>.vscode/launch.json</code></p>
<pre><code class="language-js">{
    // Use IntelliSense to learn about possible Node.js debug attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    &quot;version&quot;: &quot;0.2.0&quot;,
    &quot;configurations&quot;: [{
         &quot;type&quot;: &quot;node&quot;,
         &quot;request&quot;: &quot;launch&quot;,
         &quot;env&quot;: {
            &quot;NODE_ENV&quot;: &quot;development&quot;                  
         },
         &quot;name&quot;: &quot;Launch Program&quot;,
         &quot;program&quot;: &quot;${workspaceRoot}/server.js&quot;,
         &quot;cwd&quot;: &quot;${workspaceRoot}&quot;       
    }]
}
</code></pre>
<p>And hit f5, you can put breakpoint somehere to jsreport source and it should work.<br />
Unfortunately you wan't be able to debug your helpers this way. There are many issues with it.<br />
If this is what you want to reach, you need to stick with adding <code>console.log</code> to your helpers and run the templates with <code>Debug</code> button in studio to see the output.</p>
]]></description><link>https://forum.jsreport.net/post/178</link><guid isPermaLink="true">https://forum.jsreport.net/post/178</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>Hi Sr. Thanks.<br />
My breakpoints only work in &quot;server.js&quot; file, on other scripts don't work. I don't know why. Do you have any idea??</p>
]]></description><link>https://forum.jsreport.net/post/179</link><guid isPermaLink="true">https://forum.jsreport.net/post/179</guid><dc:creator><![CDATA[rober]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>Hm. It works for me, I can put breakpoint for example here and it gets hit when I render a template<br />
<a href="https://github.com/jsreport/jsreport-templates/blob/master/lib/templates.js#L28" rel="nofollow">https://github.com/jsreport/jsreport-templates/blob/master/lib/templates.js#L28</a></p>
<p>Not likely relevant, but I have this in my user settings</p>
<pre><code class="language-js">// Place your settings in this file to overwrite the default settings
{
    &quot;search.exclude&quot;: {      
        &quot;**/node_modules&quot;: false
    },
    &quot;eslint.autoFixOnSave&quot;: true,
    &quot;files.autoSave&quot;: &quot;onFocusChange&quot;,
    &quot;terminal.integrated.shell.windows&quot;: &quot;\\windows\\sysnative\\cmd.exe&quot;,
    &quot;workbench.colorTheme&quot;: &quot;One Monokai&quot;
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/180</link><guid isPermaLink="true">https://forum.jsreport.net/post/180</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>It don't work for me :(  I don't know why, I just want debugging in the &quot;beforeRender&quot; method, is it posible?</p>
]]></description><link>https://forum.jsreport.net/post/185</link><guid isPermaLink="true">https://forum.jsreport.net/post/185</guid><dc:creator><![CDATA[rober]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Wed, 05 Apr 2017 22:39:46 GMT]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/26">@rober</a>, as <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/3">@pofider</a> had said before, you won't be able to debug your helpers or scripts in that way, jsreport by default handle scripts and helpers execution in another process (child processes) for security reasons so i think that is the reason the VS Code can't detect breaking points in your scripts.</p>
<p>however i think that you can configure jsreport for instead of running the scripts in another process make them run in the same process, using this, VS Code should be able to detect your breakpoints because script will be running in the same process, to configure that behaviour add this to your <strong>jsreport config</strong>:</p>
<pre><code class="language-js">&quot;tasks&quot;: {
   ...other options that might you have here..
    &quot;strategy&quot;: &quot;in-process&quot;,
    ...other options that might you have here..
  },
</code></pre>
<p>that change should be sufficient for when you need to debug something in helpers or tasks</p>
]]></description><link>https://forum.jsreport.net/post/186</link><guid isPermaLink="true">https://forum.jsreport.net/post/186</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Wed, 05 Apr 2017 22:39:46 GMT</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4"><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a></a> This is good hint, but unfortunately it won't be enough. We pass such scripts to node.js vm in string and it has no way to find out it actually comes from a file.</p>
<p><a href="https://nodejs.org/api/vm.html#vm_vm_runinnewcontext_code_sandbox_options" rel="nofollow">https://nodejs.org/api/vm.html#vm_vm_runinnewcontext_code_sandbox_options</a></p>
<p><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/26">@rober</a> I believe that the solution for you is</p>
<ol>
<li>Change the strategy as <a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4"><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/4">@bjrmatos</a></a> mentioned</li>
<li>Take the code you want to debug and put it into extra file <code>myScript.js</code> in your application directory</li>
<li>Allow requiring this file with additional config <code>&quot;scripts&quot;: { &quot;allowedModules&quot;:&quot;*&quot; }</code></li>
<li>put this to your script</li>
</ol>
<pre><code class="language-js">var path = require('path')
var myScript = require(path.join(__appDirectory, 'myScript.js'))
function beforeRender(req, res, done) {
  myScript(req, res, done)
}
</code></pre>
]]></description><link>https://forum.jsreport.net/post/187</link><guid isPermaLink="true">https://forum.jsreport.net/post/187</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to How Can I Debug Jsereport in Visual Studio Code?? Thanks!! on Invalid Date]]></title><description><![CDATA[<p>perfect!!!!! It work for me!!!!!! :) Very good attention thanks!!!!</p>
]]></description><link>https://forum.jsreport.net/post/189</link><guid isPermaLink="true">https://forum.jsreport.net/post/189</guid><dc:creator><![CDATA[rober]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>