Git Product home page Git Product logo

Comments (2)

heyflynn avatar heyflynn commented on July 18, 2024

Did you ever get this fixed?

Looks like the problem I see is that you can't use async functions like that within reacts useEffect hook.

Define the async function inside the hook.

useEffect(() => {

  // what happens in vegas (in the promise) stays in vegas
   const render = async() => {
      ...
   }

   render()

},[viewportRef1])

same goes for the init of cornerstone.

from cornerstone3d.

selimcanglr avatar selimcanglr commented on July 18, 2024

It has been a while since I've fixed the issue but I think the issue was related to the faulty/missing installation of cornerstoneWADOImageLoader.
Here is what I did if someone is having a similar issue. I was initially using CRA but realized that I need to make some changes to the webpack.config.js file to install cornerstoneWADOImageLoader properly. I started a fresh project and created the webpack.config.js file manually. The important point is adding the following property to the webpack.config.js file:

    resolve: {
        alias: {
            "cornerstone-wado-image-loader": "cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js"
        }
    }

You also need the CopyWebpackPlugin installed and added to the config file. The tricky thing here is that the documentation of cornerstoneWADOImageLoader is faulty. You need to add the following property to the config file:

    plugins: [
        new CopyWebpackPlugin(
          {
            patterns: [
                {
                    from: path.resolve(__dirname, './node_modules/cornerstone-wado-image-loader/dist/dynamic-import'),
                    to: "../dist",
                },
            ]
          })
    ],

Be mindful that "to" here should point to your build folder, make sure other paths are correct as well

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.