score:0

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="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script> 

in the application.html.erb

score:1

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';

https://github.com/chartjs/chartjs-adapter-moment

score:8

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

    <script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.bundle.js"></script>

score:16

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.

score:29

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

<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.min.js"></script>

Related Query

More Query from same tag