Open robertlario opened 5 months ago
I cannot reproduce the error. Try looking if you've already done it https://www.cornerstonejs.org/docs/getting-started/installation.
Not sure what to add. I went in directly and changed "packages/core/dist/types/types" to "core/dist/types/types" and it worked fine. I did follow the installation directions as suggested.
This works for me now, so I'll just push forward until I hit this issue again.
Hey all - also getting the same error when updating to the latest tools version
Here is a StackBlitz creating the error https://stackblitz.com/edit/c3d-tools-type-error?file=index.ts
The issue is in this file
/@cornerstonejs/tools/dist/types/utilities/getViewportForAnnotation.d.ts
Its referring to an internal package (packages/core/dist/types/types
) rather than the cornerstonejs package
The fix is to change the import(s) from packages/core/dist/types/types
to @cornerstonejs/core/dist/types/types
I get the same error.
As a temporary fix, I modified the tsconfig.json:
I added this line:
"packages/core/dist/types/types": ["node_modules/@cornerstonejs/core/dist/types/types"]
in "compilerOptions" / "paths"
Describe the Bug
File getViewportsForAnnotation.d: import type { Annotation } from '../types'; export default function getViewportsForAnnotation(annotation: Annotation): (import("packages/core/dist/types/types").IVolumeViewport | import("packages/core/dist/types/types").IStackViewport)[];
Has "packages/core/dist/types/types".
File getViewportForAnnotation.d.ts : import type { Annotation } from '../types'; export default function getViewportForAnnotation(annotation: Annotation): import("packages/core/dist/types/types").IVolumeViewport | import("packages/core/dist/types/types").IStackViewport;
The directory "packages" does not exist.
Steps to Reproduce
install @cornerstonejs/tools^1.70.5
The current behavior
@cornerstonejs/tools/dist/types/utilities/getViewportForAnnotation.d.ts:2:141 - error TS2307: Cannot find module 'packages/core/dist/types/types' or its corresponding type declarations.
The expected behavior
No build error
OS
Windows 11
Node version
v18.19.0
Browser
N/A