I had the same error while trying to use chartkick gem for rails. And the solution was to install moment.js (npm install moment --save) and put

<script src=""></script> 

in the application.html.erb


If you are using npm

npm install moment chartjs-adapter-moment --save-dev

in your files

import { Chart } from 'chart.js'
import 'chartjs-adapter-moment';


You have to use the bundle version of Chartjs that already include Moment.js

    <script src=""></script>


I had this same issue and attempted Kevin's solution, but it did not work. I found that it was necessary to place the moment script before the chartjs script and regardless of the versions I used, that solved the problem for me.


It turns out, the solution entails version controls (here is what I used):

<script src=""></script>
<script src=""></script>

Related Query

More Query from same tag