You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm install chart.js --save should not install moment to node_modules
dist/Chart.min.js should not require moment
Current Behavior
npm install chart.js --save installs moment to node_modules
dist/Chart.min.js requires moment
Possible Solution
Do not include moment as a dependency in the npm distribution (I note it is only a devDependency in this repo)
Steps to Reproduce
Make a new folder
npm init
npm install chart.js --save
Look in the node_modules folder, see that moment has been installed
Look at the source code in node_modules/chart.js/dist/Chart.min.js, see require("moment")
Context
I am trying to remove usage of moment from a project which uses chart.js/dist/Chart.min.js, and am being blocked in this aim by that file's use of require('moment').
Environment
Chart.js version: 2.9.3
The text was updated successfully, but these errors were encountered:
index-1b1ff084.js:2688 TypeError: moment.hasOwnProperty is not a function at chart-graph.entry.js:18 at chart-graph.entry.js:13 at chart-graph.entry.js:16 at createCommonjsModule (_commonjsHelpers-91fffb88.js:14) at chart-graph.entry.js:5
This will be fixed in the next major version (v3) which currently has a beta release available. It cannot be fixed in v2 since removing it is a breaking change. However, we do provide adapters to switch to date-fns or luxon. https://www.chartjs.org/docs/latest/axes/cartesian/time.html#date-adapters
Expected Behavior
npm install chart.js --save
should not install moment to node_modulesdist/Chart.min.js should not require moment
Current Behavior
npm install chart.js --save
installs moment to node_modulesdist/Chart.min.js requires moment
Possible Solution
Do not include moment as a dependency in the npm distribution (I note it is only a devDependency in this repo)
Steps to Reproduce
npm init
npm install chart.js --save
require("moment")
Context
I am trying to remove usage of moment from a project which uses chart.js/dist/Chart.min.js, and am being blocked in this aim by that file's use of
require('moment')
.Environment
The text was updated successfully, but these errors were encountered: