"import" and "require"
-
Hi,
I am trying to use d3 as a library in a script for an XLSX recipe report.
Using require('d3') like with other libraries results in this error:
Unable to require module d3. require() of ES Module ... [filepath]/workerHandler.js not supported.
Instead change the require of index.js in ... [filepath]workerHandler.js to a dynamic import() which is available in all CommonJS modules.If I change it to import * as d3 from 'd3' i get this error:
Any advice?
Cheers
-
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.