react-3d-viewer icon indicating copy to clipboard operation
react-3d-viewer copied to clipboard

THREE.OBJLoader: Unexpected line: "<!DOCTYPE html>"

Open mkantz84 opened this issue 5 years ago • 8 comments

Hi, I keep getting an error when i try to load an obj file: Uncaught Error: THREE.OBJLoader: Unexpected line: "" image what can be the issue here?

mkantz84 avatar Mar 24 '19 10:03 mkantz84

Same issue here

mbuckley2000 avatar Mar 27 '19 08:03 mbuckley2000

Same issue

fitwist avatar Jul 10 '19 19:07 fitwist

Did anyone manage to fix this?

LukeV111 avatar Feb 13 '20 12:02 LukeV111

Maybe this gist will help you

fitwist avatar Feb 13 '20 14:02 fitwist

No solutions yet?

dankaki avatar Jun 18 '20 07:06 dankaki

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:

Captura de Tela 2020-07-14 às 15 56 09

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.

tbfreitas avatar Jul 14 '20 18:07 tbfreitas

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.

GSRdevelopment avatar Sep 29 '20 23:09 GSRdevelopment

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:

Captura de Tela 2020-07-14 às 15 56 09

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!

Jedliu avatar Dec 17 '20 00:12 Jedliu