JSON parse error when using GLTF loader

Hi everyone, I am really struggling to understand what is the problem with the gltf loader, basically when I try to import it with the appropriate loader it gives me this error:
image

This is my file structure:
image

This is the GLTF loader function:
image

I tried using an online GLTF viewer and it got imported with no problem. Thanks in advance

Since you also have the basic_peeler.bin file then try converting your model to GLB format, which would be a single file to load.

GLB format didn’t work also but I found a really stupid solution. I didn’t mention I was using Vite and by moving the ‘model’ folder to ‘public’ worked. Thanks anyway for your help