react-chartjs-2
react-chartjs-2 copied to clipboard
[Bug]: Error Thrown on Next Build
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
Yes I am facing the same issue. React-chartjs-2 doesnt work with nextjs
Getting this same issue.
chartjs: v3.8.0 react-chartjs-2: v4.2.0 next: v12.3.0
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.
I opened an error on Chart.js repository: https://github.com/chartjs/Chart.js/issues/10673
Putting swcMinify: false in next.config.js will resolve the issue.
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