<?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[Missing Helper issue]]></title><description><![CDATA[<p>I'm having some issues after upgrading from v2 to v3 involving the xlsx recipe.  I am using a setup involving jsreport-core, jsreport-handlebars, and jsreport-assets.  The error I'm getting:</p>
<p>Error: Missing helper: &quot;xlsxTableSheet&quot;<br />
at Object.&lt;anonymous&gt; (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\helpers\helper-missing.js:19:13)<br />
at Object.wrapper (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\internal\wrapHelper.js:15:19)<br />
at eval (eval at compile (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:35:30), &lt;anonymous&gt;:11:133)<br />
at Object.main (eval at compile (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:35:30), &lt;anonymous&gt;:19:4)<br />
at C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\async-helpers\index.js:61:22<br />
at ret (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\runtime.js:212:12)<br />
at Object.execute (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:80:14)<br />
at Object.execute (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\worker.js:27:43)<br />
at executionFn (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-core\lib\worker\render\executeEngine.js:216:40)<br />
at sandbox.js:16:18</p>
<p>I've looked around on the forums/github/stackoverflow and have run out of potential solutions, but have garnered a better understanding of what may be causing the issue.  Before rendering the template object with jsreport, it looks like this:</p>
<p>{<br />
engine: 'handlebars',<br />
recipe: 'xlsx',<br />
content: '{{!-- Resize and fill table --}}\r\n' +<br />
'{{xlsxTableSheet &quot;Data&quot; headers rows}}\r\n' +<br />
'{{xlsxWrapText}}\r\n' +<br />
'\r\n' +<br />
'{{!-- Enforces recalculation of formula cells when file is opened --}}\r\n' +<br />
'{{xlsxCalcOnLoad 1}}\r\n' +<br />
'\r\n' +<br />
'{{!-- Generates the spreadsheet --}}\r\n' +<br />
'{{{xlsxPrint}}}\r\n',<br />
helpers: ';(function (global) {\r\n' +<br />
'\r\n' +<br />
&quot;  const path = require('path');\r\n&quot; +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/xlsx&quot;))(global);\r\n' +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/math&quot;))(global);\r\n' +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/util&quot;))(global);\r\n' +<br />
'\r\n' +<br />
'  // additional functions\r\n' +<br />
'\r\n' +<br />
'  Object.assign(global, {\r\n' +<br />
'    // additional functions\r\n' +<br />
'  });\r\n' +<br />
'  \r\n' +<br />
'})(this);',<br />
xlsx: { templateAsset: [Object] }<br />
}</p>
<p>When I tried hard coding the helpers instead of requiring them as I am above it worked correctly, leading me to believe that the render function is having trouble parsing the 'require' statements within the imported file.  The helper files listed have a rough structure as follows:</p>
<p>module.exports = function (global) {<br />
....functions listed here</p>
<p>Object.assign(global, {<br />
functions aliased here<br />
}</p>
<p>This worked previously with v2, I have already verified that handlebars versions are synced correctly between packages, I am using the newer packages with @jsreport/jsreport-core, and I've run out of ideas on how to move forward with this issue.  Thanks for any help.</p>
]]></description><link>https://forum.jsreport.net/topic/2813/missing-helper-issue</link><generator>RSS for Node</generator><lastBuildDate>Wed, 17 Jun 2026 06:53:56 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2813.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Jun 2023 16:03:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Missing Helper issue on Invalid Date]]></title><description><![CDATA[<p>I'm having some issues after upgrading from v2 to v3 involving the xlsx recipe.  I am using a setup involving jsreport-core, jsreport-handlebars, and jsreport-assets.  The error I'm getting:</p>
<p>Error: Missing helper: &quot;xlsxTableSheet&quot;<br />
at Object.&lt;anonymous&gt; (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\helpers\helper-missing.js:19:13)<br />
at Object.wrapper (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\internal\wrapHelper.js:15:19)<br />
at eval (eval at compile (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:35:30), &lt;anonymous&gt;:11:133)<br />
at Object.main (eval at compile (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:35:30), &lt;anonymous&gt;:19:4)<br />
at C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\async-helpers\index.js:61:22<br />
at ret (C:\Projects2\cmd_api\node_modules\handlebars\dist\cjs\handlebars\runtime.js:212:12)<br />
at Object.execute (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\handlebarsEngine.js:80:14)<br />
at Object.execute (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-handlebars\lib\worker.js:27:43)<br />
at executionFn (C:\Projects2\cmd_api\node_modules@jsreport\jsreport-core\lib\worker\render\executeEngine.js:216:40)<br />
at sandbox.js:16:18</p>
<p>I've looked around on the forums/github/stackoverflow and have run out of potential solutions, but have garnered a better understanding of what may be causing the issue.  Before rendering the template object with jsreport, it looks like this:</p>
<p>{<br />
engine: 'handlebars',<br />
recipe: 'xlsx',<br />
content: '{{!-- Resize and fill table --}}\r\n' +<br />
'{{xlsxTableSheet &quot;Data&quot; headers rows}}\r\n' +<br />
'{{xlsxWrapText}}\r\n' +<br />
'\r\n' +<br />
'{{!-- Enforces recalculation of formula cells when file is opened --}}\r\n' +<br />
'{{xlsxCalcOnLoad 1}}\r\n' +<br />
'\r\n' +<br />
'{{!-- Generates the spreadsheet --}}\r\n' +<br />
'{{{xlsxPrint}}}\r\n',<br />
helpers: ';(function (global) {\r\n' +<br />
'\r\n' +<br />
&quot;  const path = require('path');\r\n&quot; +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/xlsx&quot;))(global);\r\n' +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/math&quot;))(global);\r\n' +<br />
'  require(path.resolve(__rootDirectory, &quot;reports/helpers/util&quot;))(global);\r\n' +<br />
'\r\n' +<br />
'  // additional functions\r\n' +<br />
'\r\n' +<br />
'  Object.assign(global, {\r\n' +<br />
'    // additional functions\r\n' +<br />
'  });\r\n' +<br />
'  \r\n' +<br />
'})(this);',<br />
xlsx: { templateAsset: [Object] }<br />
}</p>
<p>When I tried hard coding the helpers instead of requiring them as I am above it worked correctly, leading me to believe that the render function is having trouble parsing the 'require' statements within the imported file.  The helper files listed have a rough structure as follows:</p>
<p>module.exports = function (global) {<br />
....functions listed here</p>
<p>Object.assign(global, {<br />
functions aliased here<br />
}</p>
<p>This worked previously with v2, I have already verified that handlebars versions are synced correctly between packages, I am using the newer packages with @jsreport/jsreport-core, and I've run out of ideas on how to move forward with this issue.  Thanks for any help.</p>
]]></description><link>https://forum.jsreport.net/post/12171</link><guid isPermaLink="true">https://forum.jsreport.net/post/12171</guid><dc:creator><![CDATA[rsemler6789]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Missing Helper issue on Thu, 01 Jun 2023 17:17:16 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-a" href="https://forum.jsreport.net/uid/2807">@rsemler6789</a> the v3 parses the helpers differently, it parses the code in helpers and looks for top-level functions, and treat them as helpers. so it works differently</p>
<p>it is not documented but if you want to do the same helpers registration (like v2) you can do something like this:</p>
<pre><code class="language-js">__topLevelFunctions.testing = function () {
    return 'Hola'
}
</code></pre>
<p><a href="https://playground.jsreport.net/w/anon/QFCBJjJH" rel="nofollow">https://playground.jsreport.net/w/anon/QFCBJjJH</a></p>
<p>for your code i think you can change this last part to:</p>
<pre><code class="language-js">// OLD: })(this)
})(__topLevelFunctions) // NEW
</code></pre>
<p>the recommended approach is still to do it with <a href="https://jsreport.net/learn/assets#registering-helpers-from-assets" rel="nofollow">assets</a> but if you don't want to do big changes to your app then use what i described above</p>
]]></description><link>https://forum.jsreport.net/post/12172</link><guid isPermaLink="true">https://forum.jsreport.net/post/12172</guid><dc:creator><![CDATA[bjrmatos]]></dc:creator><pubDate>Thu, 01 Jun 2023 17:17:16 GMT</pubDate></item><item><title><![CDATA[Reply to Missing Helper issue on Invalid Date]]></title><description><![CDATA[<p>Thanks so much for the quick response!  The fix you recommended worked beautifully, and thanks for explaining the differences between v2 and v3 and how it handles the helpers.</p>
]]></description><link>https://forum.jsreport.net/post/12173</link><guid isPermaLink="true">https://forum.jsreport.net/post/12173</guid><dc:creator><![CDATA[rsemler6789]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>