Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read properties of undefined (reading 'vec2') at CrosshairsTool.ts:54:34 #339

Open
mxj009 opened this issue Dec 21, 2022 · 11 comments
Labels
bug verified Something isn't working, verified by maintainers

Comments

@mxj009
Copy link

mxj009 commented Dec 21, 2022

import * as cornerstoneTools from '@cornerstonejs/tools';

In Vue3, after all dependencies are installed and Cornerstone is introduced, the error of vec2 is reported

@rogerbramon
Copy link
Contributor

I'm experiencing the same issue when using it in a Next.js project. As far as I was able to investigate, this problem was introduced on commit 18aa4d8 that includes versions:

  • @cornerstonejs/tools@0.28.0
  • @cornerstonejs/core@0.20.0
  • @cornerstonejs/streaming-image-volume-loader@0.6.0.

The last working version on my case is @cornerstonejs/tools@0.27.2 combined with @cornerstonejs/core@0.19.2 and @cornerstonejs/streaming-image-volume-loader@0.5.19.

Not sure if @sedghi can provide any feedback since it was the main contributor of this version.

Using the latest versions, this error a bit different but related to loading modules:

TypeError: Cannot destructure property 'floodFill' of '_utilities__WEBPACK_IMPORTED_MODULE_1__.segmentation' as it is undefined.

Let me now if you need anything.

Thanks!

@sedghi
Copy link
Member

sedghi commented Jan 11, 2023

Hmm, the latest version error seems weird to me. I checked floodfill export and it looked fine to me here

It would help if you provide a repo link for sure

@rogerbramon
Copy link
Contributor

rogerbramon commented Jan 11, 2023

Thanks @sedghi for your fast reply!

It turn out that the problem only occurs on dev mode running the app using yarn dev. It works fine using yarn build & yarn start

I prepared a basic repo to show them problem: https://github.com/rogerbramon/cornerstone-nextjs

On main branch, you have a working setup using versions: @cornerstonejs/tools@0.27.2 combined with @cornerstonejs/core@0.19.2 and @cornerstonejs/streaming-image-volume-loader@0.5.19.

On branch cornerstone-issue-339, I just updated to the latest available versions. The error should appear just after starting the website using yarn dev command. If you use version 0.20.0 instead of the latest, you could reproduce the error mentioned by @mxj009 in the initial comment of this issue.

image

Hope that helps.

@sedghi
Copy link
Member

sedghi commented Jan 13, 2023

I think I have a fix. Maybe try it after merged

@rogerbramon
Copy link
Contributor

Thanks @sedghi! It seems to be fixed on @cornerstonejs/tools@0.35.2.

Is there anything we can do to prevent it from happening again in the future?

@sedghi
Copy link
Member

sedghi commented Jan 13, 2023

I'm not sure what was the issue. probably from next.js ts loader ...?

@rogerbramon
Copy link
Contributor

Not sure either... It seems to be happening on Vue3 too.

@sedghi
Copy link
Member

sedghi commented Jan 16, 2023

so there is still problem? what it says in Vue?

@rogerbramon
Copy link
Contributor

No, sorry for the confusion. I meant that when the issue was reported by @mxj009 it was happening on Vue3. So, the cause was probably affecting both frameworks (Next.js, Vue3). It's working for me now on Next.js.

@sedghi
Copy link
Member

sedghi commented Mar 9, 2023

related #226

@sedghi
Copy link
Member

sedghi commented Oct 13, 2023

This seem to be related to the ciruclar dependencies that we have #742
We will fix it in the version 2

@sedghi sedghi added the bug verified Something isn't working, verified by maintainers label Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug verified Something isn't working, verified by maintainers
Projects
None yet
Development

No branches or pull requests

3 participants