Skip to content
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

react and xtk #205

Open
ghost opened this issue Jul 30, 2018 · 2 comments
Open

react and xtk #205

ghost opened this issue Jul 30, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 30, 2018

Ive been using the XTK library for some scientific 3D modeling applications, and I am trying to use it in react. The library works flawlessly on its own in JavaScript but when I try to implement it in react it tells me that I need a loader for an unspecified file type. How would I figure out what the file type is? and why is this issue happening. package docs: https://www.npmjs.com/package/xtk

here is the implementation of xtk in code:

var r = new  window.X.renderer3D();
//r.container = 'r';
r.init();

// create a mesh from a .vtk file
var skull = new window.X.mesh();
skull.file = 'http://x.babymri.org/?avf.vtk';

// add the object
r.window.X.add(skull);

// .. and render it
r.render();

And here is the error message I am getting:
image

@xgui3783
Copy link

xgui3783 commented Jul 30, 2018 via email

@sraksh
Copy link

sraksh commented Mar 4, 2019

Hi,

This might be happening due to not having rules defined in your webpack to load a certain file type. Kindly check after adding this to your webpack config rules:

test: /.(dcm)(?.*)?$/,
loader: 'file-loader',
options: {
name: '[name].[ext]',
},

change the file extension as per your need.
Let us know if this worked?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants