Replies: 1 comment
-
This MIGHT be related to an issue I just figured out trying to get chartjs-plugin-datalabels to work as an ESM in Node.js v20. My modules are all .mjs and I had issues with the chartjs-plugin-datalabels.js being loaded instead of the chartjs-plugin-datalabels.esm.js module. I eventually landed on:
However that threw the following error:
Eventually I found a suggestion on a website about all of the CommonJS/ESM issues found in Node.js that said to put a one-liner package.json in a directory of modules that is having problems:
Bingo, problem solved! HOWEVER, this one-liner package.json will disable CommonJS support so if you are supporting both CommonJS and ESM modules you will need to create separate repositories for them. |
Beta Was this translation helpful? Give feedback.
-
I'm using:
I'm importing and registering this way:
On page load, I receive the following 500 error:
I have not had any trouble with chart.js. This issue only occurs when importing and registering ChartDataLabels. Is there anything I can try to resolve this?
Beta Was this translation helpful? Give feedback.
All reactions