Open pedall opened 6 years ago
I was getting the same exact error. It seemed that Canvas was returning null for getContext. I tried looking into the canvas module but kept getting this error: "Too many levels of symbolic links" so I just removed the folder and reinstalled it with npm and that did the trick.
same problem for me : "canvas": "2.0.0-alpha.11", "chart.js": "^2.7.2", "chartjs-node": "^1.6.1",
error :
Unhandled rejection TypeError: Cannot read property 'length' of null
at Object.acquireContext (/Users/xxx/Documents/xxx/Docker/xxx/node_modules/chart.js/src/platforms/platform.dom.js:340:19)
at Chart.construct (/Users/xxx/Documents/xxx/Docker/xxx/node_modules/chart.js/src/core/core.controller.js:79:27)
Mac OS X 10.13.3, node v8.9.3
Same problem for me tried 2.0.0-alpha.8? Any solutions or fixes to this would be great.
which platform Windows or Linux
I have also got the error in windows platform but when I used Ubuntu it works fine. I got an error in windows after installation of canvas 2.0.0-alpha.13
xyz\node_modules\bluebird\js\release\async.js:61
fn = function () { throw arg; };
^
TypeError: Cannot read property 'length' of null
at Object.acquireContext (E:\app_server\node_modules\chart.js\src\platforms\platform.dom.js:340:19)
at Chart.construct (E:app_server\node_modules\chart.js\src\core\core.controller.js:79:27)
at new Chart (E:\app_server\node_modules\chart.js\src\core\core.js:42:8)
at jsdom.envAsync.then.window (E:\app_server\node_modules\chartjs-node\index.js:106:31)
at tryCatcher (E:\app_server\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (E:\app_server\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (E:\app_server\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (E:\app_server\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (E:\app_server\node_modules\bluebird\js\release\promise.js:693:18)
at Promise._fulfill (E:\app_server\node_modules\bluebird\js\release\promise.js:638:18)
at Object.done (E:\app_server\node_modules\bluebird\js\release\nodeback.js:42:21)
at process.nextTick (E:\app_server\node_modules\jsdom\lib\jsdom.js:320:18)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
still not resolved :(
I am getting the same in osx 10.12.6
I am suffering the same issue.
"canvas": "^2.0.1", "node-gyp": "^3.8.0", "chartjs-node": "^1.7.1", OS: Windows Node version: 8.9.4
Is this repo alive or was it abandoned? I see there was a time since last commit
Also getting this same issue on Windows with any version of chartjs-node other than alpha2. Is there any fix for this?
@tudorific the only way I was able to fix it was to downgrade canvas to a 1.6.x version. It is not working with canvas 2.x versions
(gdeliaesgine is my account at work but I answered you from home, using another user hehe)
@gonnza thanks! I ended up downgrading to canvas 1.6.13 and that is working just fine. Thanks for the input, that definitely helped me out! :)
bump, also having this problem with canvas 2.x, but resolves with older versions. Any updates on why this is happening with recent versions?
The error is: "Unhandled rejection TypeError: Cannot read property 'length' of null".
node: 8.11.3 chartjs-node: 1.7.1 chart.js: 2.7.3 canvas: 2.3.1 OS: Mac 10.14.2
Any better solutions than just downgrading the canvas version?
my package.json versions
"canvas": "2.0.0-alpha.8" "chart.js": "^2.7.1", "chartjs-node": "^1.6.0",
When using
"canvas": "^2.0.0-alpha.2",
node-chartjs works like a charm, when using"canvas": "^2.0.0-alpha.8",
item is null in acquireContext so item.length errors inplatform.dom.js
Can someone please help me and tell me what im doing wrong?