Git Product home page Git Product logo

Comments (8)

jennydaman avatar jennydaman commented on August 18, 2024 9

I'm @PintoGideon's coworker.

For anyone else here looking for a workaround, see FNNDSC/ChRIS_ui#1060

UMD seems to be working but ESM (the default) does not. So create an alias in vite.config.ts to prefer the UMD build of @cornerstonejs/tools:

import { defineConfig } from "vite";

export default defineConfig({
  resolve: {
    alias: {
      "@cornerstonejs/tools": "@cornerstonejs/tools/dist/umd/index.js"
    },
  },
});

from cornerstone3d.

jlopes90 avatar jlopes90 commented on August 18, 2024

#1067 (comment)

from cornerstone3d.

sedghi avatar sedghi commented on August 18, 2024

seems like someone tried this and works for now

alias: {
'@cornerstonejs/tools': '@cornerstonejs/tools/dist/umd/index.js'
}
}`

from cornerstone3d.

jlopes90 avatar jlopes90 commented on August 18, 2024

The umd works, but the problem is compressed and it doesn't seem to have a source map.

image

from cornerstone3d.

sedghi avatar sedghi commented on August 18, 2024

I know :( we will fix it in next version since it will be a breaking change

from cornerstone3d.

fanhenghui avatar fanhenghui commented on August 18, 2024

seems like someone tried this and works for now

alias: { '@cornerstonejs/tools': '@cornerstonejs/tools/dist/umd/index.js' } }`

The code can be bundled, but it cannot run properly.

from cornerstone3d.

desprit avatar desprit commented on August 18, 2024

While the "alias" workaround fixes some issues the current version still cannot run on vitest for example and gives the following error:

Module node_modules/@cornerstonejs/core/src/index.ts:1 seems to be an ES Module but shipped in a CommonJS package. You might want to create an issue to the package "@cornerstonejs/core" asking them to ship the file in .mjs extension or add "type": "module" in their package.json.

Are there plans for a proper fix?

from cornerstone3d.

Qwd2017 avatar Qwd2017 commented on August 18, 2024

"node_modules@cornerstonejs\tools\src\workers\polySegConverters.js" is not packed to umd module and polyseg worker is not worked

from cornerstone3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.