Skip to content

[Bug] decodeImageFrameWorker fails to load Vue+Vite+Nuxt #1876

Open
@yaroslavskriaga

Description

@yaroslavskriaga

Describe the Bug

Hello, thanks for the project and amazing technology you build. I am working on the prototype of the viewer using Cornerstone3D. I found out, that after upgrading to the latest, it stopped working. I have a black box instead of an image.

Important notes about setup:

  1. Cornerstone3D and Viewer are inside a separate npm package which I install in the 'Main application'.
  2. 'Main application' is a Nuxt application and consumes a package via npm install.
  3. I did my own research and basically copied version and all of the dependencies from https://github.com/cornerstonejs/vue-cornerstone3d.
  4. Inside a package from p.1 with Cornerstone3D, I have viteCommonjs() under plugins, optimizeDeps as per the example repository from p.3, worker object contains format: 'es' and external is ['@icr/polyseg-wasm'].
  5. I was also following a migration guide and I put cornerstoneDICOMImageLoader.init({}) as it is a new approach now.

As a last note, It suddenly stopped working after an update to the latest version. Previous version was 1.85 and it didn't contain anything that is required now and was working perfectly. I only had this line under resolve: '@cornerstonejs/tools': '@cornerstonejs/tools/dist/umd/index.js' which I obviously removed for now.

Am I missing something?

Steps to Reproduce

Sorry, currently I don't have a sharable link with the reproduction. I hope, my description covers most of the questions.

  1. Create a npm package and put a cornerstone viewer there.
  2. Create a separate Nuxt application and npm install the package from p1.
  3. You will notice that decodeImageFrameWorker resolves with a content type text/html and results in error in a console

The current behavior

In the console, it says Failed to load module script: The server responded with a non-JavaScript MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

Image Image Image

The expected behavior

No error about the decodeImageFrameWorker and it works all together with the given setup

OS

MacOs 14.6.1

Node version

18.17.1

Browser

Chrome 133.0.6943.98

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions