-
Notifications
You must be signed in to change notification settings - Fork 70
No loader is configured for ".glsl" files when using itk-vtk-viewer in react app with vite #705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I tried to add alias in vite, but still got the itkConfig.js resolving error. so the steps are like below:
|
After I add the optimizeDeps and viteStaticCopy to the vite.config.js as following (and I also changed the way I import itk-vtk-viewer to the way you said here,
the glsl errors go away, but the webpage got console errors like below, And I notice there is no pipeline.worker.js under |
I put the code in github, feel free to play with it if you like https://github.com/Tinanuaa/vite-react-app |
Simplest way to put itk-vtk-viewer in your app is to use the CDN. This project does that: |
I was able to set it up after I change the dest for viteStaticCopy plugin from"." to "./src" like below.
But then I always got error like below: I'm calling the createView inside App.tsx
I also tried to use React ref to get the container, but still doesn't work
So I want to embed the viewer inside the page, with some statistics information above the viewer, so the viewer doesn't take the whole page, is it possible? |
Pass the plain HTMLElement?
|
Thanks, it works now! |
Sorry to disturb you again, but I notice sometimes the histogram doesn't show, like below,I'm just displaying the example image(https://data.kitware.com/api/v1/file/564a65d58d777f7522dbfb61/download/data.nrrd), and it works before, it just suddenly doesn't have the histogram Source code is as below
|
Strange. I see there are 2 three line expand/collapse menu buttons at the top left of the 2D GUI. That's not right ether.
|
React has some docs on creating a boolean ref to make a useOnMounted like hook. But regarding the histogram here is where to start debugging:
|
Hi, I'm trying to use itk-vtk-viewer in my vite react typescript project, node version is v20.3.1, but I got errors like below:
The steps to reproduce this error is quite simple, I just
My vite.config.js is like below
my package.json is like
May I know why the itkConfig.js file is not imported correctly in those two files? I notice itkConfig.js is three levels up those two files. I've tried to set up the alias in vite, but it doesn't work. And for the glsl loader, I added glsl plugins in the vite plugins, but still got the errors relating to the glsl files.
The text was updated successfully, but these errors were encountered: