cornerstoneTools icon indicating copy to clipboard operation
cornerstoneTools copied to clipboard

Uncaught TypeError: Cannot read property 'point' of undefined at HTMLDivElement.g (app.js:50865)

Open rangata opened this issue 8 years ago • 7 comments

Hello, Guys!

I just started to develop my own project using cornerstone libraries on top of Laravel 5.6 + Vue.

The image element init, but when I try to apply any filter from cornerstoneTools I get this errorUncaught TypeError: Cannot read property 'point' of undefined at HTMLDivElement.g (app.js:50865)

Here is my source code:

rangata avatar May 01 '18 09:05 rangata

I also have the same problem. did you fixed it?

ofleaf avatar Jul 03 '18 06:07 ofleaf

Do you have a repository or codesandbox you can share that produces this error? Also, your code formatting is a bit off. Can you edit your question to make it easier to read?

dannyrb avatar Jul 03 '18 12:07 dannyrb

@dannyrb Could you check my repo? When I write pure javascript don't appear the problem. I think, it doesn't find canvas element. And I looking for the problem from lifecycle. It seems to execute mouseInput.enable before creating element. Just I guessed it. https://github.com/ofleaf/webpacs-proto

ofleaf avatar Jul 04 '18 09:07 ofleaf

This component? I'll take a peak on Monday:

  • https://github.com/ofleaf/webpacs-proto/blob/master/src/components/worklist/WorkList.vue

We're using Cornerstone + Vue in production, so it shouldn't be too hard to see what we're doing differently.

dannyrb avatar Jul 04 '18 18:07 dannyrb

@dannyrb Yes, the WorkList.vue component. Could you tell me which part is causing the problem?

ofleaf avatar Jul 05 '18 00:07 ofleaf

It's a little bit easier to see when you use the unminified version of cornerstone-tools for development. You can do that by changing your import:

minified (default): import * as cornerstoneTools from 'cornerstone-tools';

unminified: import * as cornerstoneTools from 'cornerstone-tools/dist/cornerstoneTools.js';

image

The error I'm seeing shows that you didn't setup cornerstoneMath as an external dependency. It's likely used by one of the tools for help calculating something.

dannyrb avatar Jul 05 '18 20:07 dannyrb

@dannyrb Thanks for reply. I fixed it. cornerstoneTools.external.cornerstoneMath = cornerstoneMath

ofleaf avatar Jul 06 '18 06:07 ofleaf