react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

[Bug]: Error Thrown on Next Build

Open LouisJackson opened this issue 3 years ago • 4 comments

Would you like to work on a fix?

  • [ ] Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

With NextJS, the library works well on development. But an error is thrown after running the app after building it. RangeError: minimumFractionDigits is out of range

Tried to setup the easiest example possible on the repo.

Reproduction

https://github.com/LouisJackson/react-chart-test

chart.js version

v3.9.1

react-chartjs-2 version

v4.3.1

Possible solution

No response

LouisJackson avatar Sep 14 '22 14:09 LouisJackson

Yes I am facing the same issue. React-chartjs-2 doesnt work with nextjs

reactivicky avatar Sep 14 '22 14:09 reactivicky

Getting this same issue.

chartjs: v3.8.0 react-chartjs-2: v4.2.0 next: v12.3.0

ktpi2000 avatar Sep 15 '22 09:09 ktpi2000

Hi guys. react-chartjs-2 is just the wrapper around Chart.js, looks like this issue is in Chart.js, so please create a related problem in the Chart.js repository.

dangreen avatar Sep 15 '22 10:09 dangreen

I opened an error on Chart.js repository: https://github.com/chartjs/Chart.js/issues/10673

LouisJackson avatar Sep 15 '22 13:09 LouisJackson

Putting swcMinify: false in next.config.js will resolve the issue.

LeeLenaleee avatar Sep 22 '22 12:09 LeeLenaleee

Had the same issue, and fixed it by using swcMinify: false as stated above.

Just here to say the issue seems fixed in NextJS 13, so you can remove swcMinify: false when you use NextJS 13

jvandenaardweg avatar Nov 21 '22 08:11 jvandenaardweg