Error While Loading blender model in athree.js file

Whenever I try importing a blender model in the file I get this error:Error loading model: SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "… is not valid JSON

The part of the code I use is:
import { GLTFLoader } from ‘three/examples/jsm/loaders/GLTFLoader’;
const loader = new GLTFLoader();
loader.load(“asteroid.glb”, (gltf) => {
asteroid = gltf.scene;
scene.add(asteroid);
console.log(“Asteroid model loaded:”, asteroid);
}, undefined, (error) => {
console.error(“Error loading model:”, error);
});

I use parcel to run project on a local server. The asteroid.glb file is in a public folder. I also tried putting a ‘/’ before the path but no use.
I have no idea what to do right now

Generally this error means the browser could not find the file at the specified URL, it’s hard to say more than that without the full demo. If you’re using Parcel v2 (different from v1!) then you might need to look into GitHub - elwin013/parcel-reporter-static-files-copy: ParcelJS v2 plugin to copy static files, Parcel does not serve static files by default.

In my experience Vite can be a bit easier to get started with than Parcel, if you are starting a new project.