reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Include chart.js library while initializing to fix window reference n… #143

Open arjunskumar47 opened 7 years ago

arjunskumar47 commented 7 years ago

Found a bug while starting my node server

ReferenceError: window is not defined
    at /home/xxxx/xxxx/node_modules/chart.js/src/core/core.helpers.js:584:10
    at module.exports (/home/xxxx/xxxx/node_modules/chart.js/src/core/core.helpers.js:592:4)
    at Object.<anonymous> (/home/xxxx/xxxx/node_modules/chart.js/src/chart.js:6:31)
    at Module._compile (module.js:541:32)
    at Module._extensions..js (module.js:550:10)
    at Object.require.extensions.(anonymous function) [as .js] (/home/xxxx/xxxx/node_modules/babel-register/lib/node.js:156:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function._load (/usr/local/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)