-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error running the latest chartjs-plugin-datalabels with NextJS #350
Comments
Same issues here. |
@simonbrunel any ideas? :) |
This package uses chart.js 3.0 |
@DecadentIpsum Sorry, no idea. Do you use any other Chart.js plugins that actually work with your setup? You could try with the new plugin version 2.2.0, however I don't think it will change anything. If you need people to help you with your issue, you will have to provide a way to reproduce it. |
Same problem here. I deleted node_modules, yarn.lock and even cleared cache before installing dependencies again but nothing worked. |
@simonbrunel I think the plugin must be defined as "module" and defines the exports. See chartjs/chartjs-plugin-annotation#815 and other plugins (gradient https://github.com/kurkle/chartjs-plugin-gradient/blob/master/package.json) |
Thanks @stockiNail for the info. While you are probably right, I don't want to blindly push these changes but first would like to experiment with the reported cases. Also, we need to be sure that it doesn't break existing integrations since changing @DecadentIpsum @dqve @ignaciodiazb @NotTimTam can one of you please share a minimal repo that reproduces this issue? I'm not familiar with Next.js and don't have much time to figure out by myself. |
@simonbrunel thanks a lot for your interest in resolving this issue 🙂 Here is a minimal repo with the reproduction of the issue https://codesandbox.io/s/elated-haze-d3fj4w?file=/pages/index.js |
Same issue here. I am using sveltekit version 1.0 and Vite 4.0 The big change with Vite4 was the switch to Rollup3. That's interesting because the dev server built into vite uses ESBuild. The dev server using ESBuild runs the project just fine. I only run into issues when I try to use Rollup3 to build the project. |
@simonbrunel Maybe it can help: chartjs/Chart.js#10914 (comment) |
Thanks @stockiNail! I'm very surprised about such decision. I'm also wondering if it's actually the root cause of plugins breaking in NextJS or if it's unrelated. |
It shouldn't be related (but my knowledge is so low about JS packaging, therefore don't trust my answer!). |
Also getting this with "next": "13.0.3", "chart.js": "4.0.1", and "chartjs-plugin-datalabels": "2.2.0". Hopefully a fix is coming in soon. |
Same here, having problems with chart.js v4 and the latest version of "chartjs-plugin-datalabels"
Hoping for a soon fix, thanks. |
Noticed that chartjs 4.1.1 was released yesterday. Bumped up the version to 4.1.1 in the previously shared codesandbox, and all appears to be working! |
I can confirm that ChartJS 4.1.1 seems to clear the error! |
That's a good news! Thanks @Fish1 and @DecadentIpsum for checking and keep us updated. @dqve @ignaciodiazb @NotTimTam @epleaner @dahsser can you guys also confirm that Chart 4.1.1 fixes your issue? |
Yes. chart.js 4.1.1 solves the problem |
I had the same problem using nextJs. Chart.js 4.1.1 and chartjs-plugin-datalabels 2.2.0 worked perfectly |
Hello,
I am developing a NextJS site and I installed the latest "chartjs-plugin-datalabels".
When I am running my project I got the following error:
I am using Node v18.12.1 and Chart.js 4.0.1.
Any ideas?
I really appreciate any help you can provide.
The text was updated successfully, but these errors were encountered: