Git Product home page Git Product logo

Comments (8)

richardc-zapsurgical avatar richardc-zapsurgical commented on July 18, 2024

Closing issue since it seems to have been a Vite issue. Specifically, Vite uses ESbuild in development and then ESbuild was reordering the class RequestPoolManager definition and converting it to a variable which broke hoisting.

Excluding @cornerstone/core and then using vite-plugin-commonjs helped fix it for now.

from cornerstone3d.

sghgw avatar sghgw commented on July 18, 2024

I ran into the same issue today. Could you please explain your solution a little bit further? I installed vite-plugin-commonjs and added it to my vite.config.js file:

optimizeDeps: {
    exclude: ['@cornerstonejs/tools', '@cornerstonejs/core'],
    esbuildOptions: {
      plugins: [
        esbuildCommonjs(['@cornerstonejs/tools', '@cornerstonejs/core'])
      ]
    }
  },
plugins: [
    vue(),
    viteCommonjs()
]

But it does not work for me. What exactly does the correct configuration look like?
I would greatly appreciate any help. Thank you.

from cornerstone3d.

richardc-zapsurgical avatar richardc-zapsurgical commented on July 18, 2024

Ended up not using cornerstone for performance reasons, so I'm just browsing through old code to see what might work.

Try this:

{
  define: {
    global: {}
  },

  build: {
    minify: false,
  },
  plugins: [
    vue(),
    viteCommonjs(),
  ],
  optimizeDeps: {
    exclude: ['@cornerstonejs/core']
  }
}

from cornerstone3d.

LSanchez94 avatar LSanchez94 commented on July 18, 2024

Hello, I'm having the same error, I already applied this changes, but now I'm getting and error with other dependencies that cornerstone use like globalThis, how did you solve that? because I'm unabled or running the project.

from cornerstone3d.

mxj009 avatar mxj009 commented on July 18, 2024

the above is not a standard solution, but also depends on the framework support

from cornerstone3d.

acegank avatar acegank commented on July 18, 2024

@LSanchez94 me too? what do you solve this?

from cornerstone3d.

debashis-strativ avatar debashis-strativ commented on July 18, 2024

@LSanchez94 me also facing the same error. are you solve this or use similar anything?

from cornerstone3d.

debashis-strativ avatar debashis-strativ commented on July 18, 2024

@richardc-zapsurgical hey I use your mentioned configuration. but now I am getting an error with other dependencies that is cornerstone use globalThis, how did you solve that? I am not found any solution. Please help.

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.