Open mxj009 opened 1 year ago
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:
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!
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
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.
Hope that helps.
I think I have a fix. Maybe try it after merged
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?
I'm not sure what was the issue. probably from next.js ts loader ...?
Not sure either... It seems to be happening on Vue3 too.
so there is still problem? what it says in Vue?
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.
This seem to be related to the ciruclar dependencies that we have #742 We will fix it in the version 2
import * as cornerstoneTools from '@cornerstonejs/tools';
In Vue3, after all dependencies are installed and Cornerstone is introduced, the error of vec2 is reported