Need help importing .glb file using node/parcel to bundle

const loader = new GLTFFileLoader();
loader.load(
‘/src/assets/Work_22.glb’,
function (gltf) {

    const sink = scene.getMeshByName("Plane.002");
   
    console.log("Mesh imported:", gltf);
  },
  null,
  function (error) {
    console.error(error);
  }
);

This is the code i’m using and it doesn’t seem to work also i’m new to web coding so i’m still not sure how things work, i’ve tried looking at the documentation, but it didn’t work. I want to be able to import the local glb file so i can practice on some animation. If there is another way i can just get my model to load it would be great, idk what i’m doing i’m just stuck please help

Hello and welcome!

If you not sure what you are doing I would recommend to use in the beginning one of the working templates, for example GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely.
There are also plenty of other Babylon+node templates (if you would search Github) with other bundlers.

2 Likes