Can't load model in webpack dev environment

Hi
How do I have to set the path to the model?
(I did it like in the documentation)

The model can’t be found:

Kind regards
Alain

try this name on loader.load( “./models/building_02_220919_2.gltf”,…)

Does not work either:
image

webpack may need to be configured to serve static files. see various answers to:

I made it work by putting the file into /static

BUT now Webpack, for some reasons, searches also for a .bin-file-type with the same name and obviously can’t find it.
How to prevent that unnecessary filepath?

Webpack seems to me a bit overengineered, it makes simple things complicated :slight_smile:

Just another option, if you want to use only a cli interface, just use the define option of webpack. I add the following script in my package.json :

"build-production": "webpack -p --define process.env.NODE_ENV='\"production\"' --progress --colors"

So I just have to run npm run build-production .

your import file is not correctly
set
like
import * as THREE from “…/three js/build/three.js”;
import { GLTFLoader } from “…/three js/loaders/GLTFLoader.js”;

try to duable dot like ("…/models/building_02_220919_2.gltf”,…)

@Ajay I don’t understand your suggestion.
Pathes are correct and the threejs-library is imported, else I would get an error-message.

The only thing now is, that webpack, in addition, is searching for building_02_220919_2.bin but I only entered building_02_220919_2.gltf

How can I prevent Webpack doing this?

It was the point.
But I don’t know why Webpack searches for *.bin if you forget the point.

1 Like

@Alain try to loader manager