Chartjs-Aurelia – Unhandled rejection – Chart.js and Moment.js

0👍

Moment.js as to be set as a global variable so that Chart.js‘s time scale can work.

Doing

import { Moment } from 'moment';
window.Moment = Moment;

should fix it.

0👍

Change your moment definition in aurelia.json to the following:

{
  "name": "moment",
  "path": "../node_modules/moment",
  "main": "moment"
},

Leave a comment