Why it is getting SyntaxError while building it doesn't throw any error

Hi Guys, I am new to three js Let me tell you What I did till now

  1. Downloaded parcel
  2. downloaded three js using npm
  3. added public folder and inside it added .glb file.
  4. created index.html and the code in it you can find it below
  5. created index.js file and added code inside it u can find it below


        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="index.js" type="module"></script>


import * as THREE from 'three';
import {GLTFLoader} from 'three/examples/jsm/loaders/GLTFLoader.js';

const loader = new GLTFLoader();

loader.load('/Cartoon_boy.glb', function(glb) {
}, undefined, function(error) {

I am getting this kinds of wired error

index.js:9 SyntaxError: Unexpected token '<', "<html>
  "... is not valid JSON
    at JSON.parse (<anonymous>)
    at GLTFLoader.parse (GLTFLoader.js:315:17)
    at Object.onLoad (GLTFLoader.js:211:11)
    at three.module.js:40387:38

Your topic is much likely a duplicate of: SyntaxError: Unexpected token < in JSON at position 0

I cannot find the 3d model output in the link that you sent.

The problem is the same like in the linked topic. Your backend does not serve a glTF asset (but a HTML file).

yes then what should I do, the link you sent doesn’t include solution. can you let me know the steps to follow to solve it.

Try it with: javascript - three.js GLTFLoader() "Unexpected token" error - Stack Overflow

BTW: Better to ask web server related question at the respective community. This is actually a Parcel, not a three.js issue.

ya I will take care
but really there isn’t any best solution for this kind of thing
sorry but the docs are very much poor.