<?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[&quot;import&quot; and &quot;require&quot;]]></title><description><![CDATA[<p>Hi,</p>
<p>I am trying to use d3 as a library in a script for an XLSX recipe report.</p>
<p>Using require('d3') like with other libraries results in this error:<br />
Unable to require module d3. require() of ES Module ... [filepath]/workerHandler.js not supported.<br />
Instead change the require of index.js in ... [filepath]workerHandler.js to a dynamic import() which is available in all CommonJS modules.</p>
<p>If I change it to import * as d3 from 'd3' i get this error:</p>
<p><img src="/uploads/files/1661410890144-screen-shot-2022-08-25-at-5.00.48-pm.png" alt="0_1661410888869_Screen Shot 2022-08-25 at 5.00.48 pm.png" class="img-responsive img-markdown" /></p>
<p>Any advice?</p>
<p>Cheers</p>
]]></description><link>https://forum.jsreport.net/topic/2545/import-and-require</link><generator>RSS for Node</generator><lastBuildDate>Mon, 12 Oct 2026 09:48:59 GMT</lastBuildDate><atom:link href="https://forum.jsreport.net/topic/2545.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Aug 2022 07:01:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to &quot;import&quot; and &quot;require&quot; on Invalid Date]]></title><description><![CDATA[<p>Hi,</p>
<p>I am trying to use d3 as a library in a script for an XLSX recipe report.</p>
<p>Using require('d3') like with other libraries results in this error:<br />
Unable to require module d3. require() of ES Module ... [filepath]/workerHandler.js not supported.<br />
Instead change the require of index.js in ... [filepath]workerHandler.js to a dynamic import() which is available in all CommonJS modules.</p>
<p>If I change it to import * as d3 from 'd3' i get this error:</p>
<p><img src="/uploads/files/1661410890144-screen-shot-2022-08-25-at-5.00.48-pm.png" alt="0_1661410888869_Screen Shot 2022-08-25 at 5.00.48 pm.png" class="img-responsive img-markdown" /></p>
<p>Any advice?</p>
<p>Cheers</p>
]]></description><link>https://forum.jsreport.net/post/11068</link><guid isPermaLink="true">https://forum.jsreport.net/post/11068</guid><dc:creator><![CDATA[AB-D]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to &quot;import&quot; and &quot;require&quot; on Invalid Date]]></title><description><![CDATA[<p>Just FYI I got around this issue by creating a asset js file and just importing that as an asset into the script. So it is not urgent.</p>
]]></description><link>https://forum.jsreport.net/post/11069</link><guid isPermaLink="true">https://forum.jsreport.net/post/11069</guid><dc:creator><![CDATA[AB-D]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>