I want to import obj file and render it using react-3d-viewer. I created viewer component and sample_03.obj file exist in the same component folder. When I try to next line, it occurs compile error.
component.js
import object3 from './sample_03.obj';
compile error
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
Unexpected character ' ' (1:1)
File: src\components\ObjectViewer\sample_03.obj:1:1
failed Re-building development bundle - 0.865s
[ ] 0.000 s0/3 0 Writing page-data.json files to publ
ERROR in ./src/components/ObjectViewer/sample_03.obj 1:1
Module parse failed: Unexpected character ' ' (1:1)
You may need an appropriate loader to handle this file type,
currently no loaders are configured to process this file. Seehttps://webpack.js.org/concepts#loaders
> # Blender v2.74 (sub 0) OBJ File:
'tigre_sumatra_sketchfab.blend'
| # www.blender.org
| mtllib tigre_sumatra_sketchfab.mtl
@ ./src/components/ObjectViewer/index.js 8:0-38
@ ./src/pages/contact.tsx?export=head 10:0-54 186:41-53
@ ./.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js
21:45-163
@ ./.cache/app.js 16:0-52 30:87-34:1 33:29-42 36:29-42 30:0-34:2
develop compiled with 1 error
I want to import sample_03.obj file and render it properly without error.