react-3d-viewer
react-3d-viewer copied to clipboard
THREE.OBJLoader: Unexpected line: "<!DOCTYPE html>"
Hi,
I keep getting an error when i try to load an obj file: Uncaught Error: THREE.OBJLoader: Unexpected line: ""
what can be the issue here?
Same issue here
Same issue
Did anyone manage to fix this?
Maybe this gist will help you
No solutions yet?
I just did make a simple test and did move .obj to "avatars" folder, found in public folder, and it worked. I realized that some components use relative folder to describe the source path, how showed below:

I'm using a react template named 'Core-ui-free-react-admin'. So, althought i keep researching how to fix through the right way, I just dropped .obj files in avatars for now.
the src parameter only takes a url, so, it must be the physical direction of the file in the computer that tha project is hosted in or a web url from where the model can be downloaded. e.g: https://groups.csail.mit.edu/graphics/classes/6.837/F03/models/teapot.obj if you are passing a string variable with the contents of the file IT'S NOT going to work and there is no workaround this parameter, or not that I know of. I also tried to parse it with three.js methods and it didn't work, so yeah, you could assume this parameter is of strict nature.
I just did make a simple test and did move .obj to "avatars" folder, found in public folder, and it worked. I realized that some components use relative folder to describe the source path, how showed below:
![]()
I'm using a react template named 'Core-ui-free-react-admin'. So, althought i keep researching how to fix through the right way, I just dropped .obj files in avatars for now.
Just put the model in the public folder solves my problem! Thank you!