<?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[SyntaxError: Unexpected token &lt; in JSON at position 0 @ &#x2F;work&#x5C;jsreport&#x5C;jsreport&#x5C;node_modules&#x5C;vm2&#x5C;lib&#x2F;contextify.js:89]]></title><description><![CDATA[<p>hi,</p>
<p>I have script binded to a report.<br />
and when I call that report it throws error.</p>
<pre><code>2020-10-15T07:34:28.377Z - debug: Executing script MyScript

/work\jsreport\jsreport\node_modules\vm2\lib/contextify.js:89
                                        throw Decontextify.value(e);
                                        ^
SyntaxError: Unexpected token &lt; in JSON at position 0
    at JSON.parse (&lt;anonymous&gt;)
    at Proxy.result.on (evaluate-user-script.js:46:39)
    at Object.apply (/work\jsreport\jsreport\node_modules\vm2\lib/contextify.js:87:36)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
</code></pre>
<p>even the begining of the beforerender does not run.<br />
I don't see console log in first line.</p>
<pre><code class="language-js">function beforeRender(req, res, done) {
    console.log(&quot;beforerender&quot;);
</code></pre>
<p>I didn't changed anything in the environment.<br />
it was working for my previous calls.</p>
<p>what can be the reason?</p>
<p>where is the node_modules files in windows?</p>
<p>how can I delete and re-install packages?</p>
]]></description><link>https://forum.jsreport.net/topic/1766/syntaxerror-unexpected-token-in-json-at-position-0-work-jsreport-jsreport-node_modules-vm2-lib-contextify-js-89</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 10:57:22 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/1766.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 15 Oct 2020 07:40:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to SyntaxError: Unexpected token &lt; in JSON at position 0 @ &#x2F;work&#x5C;jsreport&#x5C;jsreport&#x5C;node_modules&#x5C;vm2&#x5C;lib&#x2F;contextify.js:89 on Invalid Date]]></title><description><![CDATA[<p>hi,</p>
<p>I have script binded to a report.<br />
and when I call that report it throws error.</p>
<pre><code>2020-10-15T07:34:28.377Z - debug: Executing script MyScript

/work\jsreport\jsreport\node_modules\vm2\lib/contextify.js:89
                                        throw Decontextify.value(e);
                                        ^
SyntaxError: Unexpected token &lt; in JSON at position 0
    at JSON.parse (&lt;anonymous&gt;)
    at Proxy.result.on (evaluate-user-script.js:46:39)
    at Object.apply (/work\jsreport\jsreport\node_modules\vm2\lib/contextify.js:87:36)
    at emitNone (events.js:111:20)
    at IncomingMessage.emit (events.js:208:7)
    at endReadableNT (_stream_readable.js:1064:12)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
</code></pre>
<p>even the begining of the beforerender does not run.<br />
I don't see console log in first line.</p>
<pre><code class="language-js">function beforeRender(req, res, done) {
    console.log(&quot;beforerender&quot;);
</code></pre>
<p>I didn't changed anything in the environment.<br />
it was working for my previous calls.</p>
<p>what can be the reason?</p>
<p>where is the node_modules files in windows?</p>
<p>how can I delete and re-install packages?</p>
]]></description><link>https://forum.jsreport.net/post/7898</link><guid isPermaLink="true">https://forum.jsreport.net/post/7898</guid><dc:creator><![CDATA[bt-serdarbuyuktemiz]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to SyntaxError: Unexpected token &lt; in JSON at position 0 @ &#x2F;work&#x5C;jsreport&#x5C;jsreport&#x5C;node_modules&#x5C;vm2&#x5C;lib&#x2F;contextify.js:89 on Fri, 16 Oct 2020 16:37:29 GMT]]></title><description><![CDATA[<p>What if you remove the script content and keep just</p>
<pre><code class="language-js">function beforeRender(req, res) {

}
</code></pre>
<p>Does it also crash?<br />
Don't you have some other scripts that are <a href="https://jsreport.net/learn/scripts#global-scripts" rel="nofollow">marked as global</a>? Mabe it's crashing there.<br />
It seems like something in your scripts is calling <code>JSON.parse()</code> on an invalid json.</p>
<blockquote>
<p>where is the node_modules files in windows?</p>
</blockquote>
<p>typically in your application folder</p>
<blockquote>
<p>how can I delete and re-install packages?</p>
</blockquote>
<p>you can delete the node_modules and call <code>npm i</code> inside the app folder. (Be sure to backup everything)<br />
However, I would rather explore your scripts first.</p>
]]></description><link>https://forum.jsreport.net/post/7912</link><guid isPermaLink="true">https://forum.jsreport.net/post/7912</guid><dc:creator><![CDATA[jan_blaha]]></dc:creator><pubDate>Fri, 16 Oct 2020 16:37:29 GMT</pubDate></item></channel></rss>