Uncaught SyntaxError: Unexpected token ':' (at abarth131.gltf?import:2:9)

Hello everyone, so i’m trying to make a simple game with three.js
My first step here is loading a GLTF file, but gives me this error:
Uncaught SyntaxError: Unexpected token ‘:’ (at abarth131.gltf?import:2:9)

What i tried?
check the path
change the GLTF to public
in GLTF viewer the model loads normally

I dont know

here is my code:

let scene, camera, renderer, light

function init(){
  scene = new three.Scene()
  scene.background = new three.Color(0xdddddd)

  camera = new three.PerspectiveCamera(40, window.innerWidth/window.innerHeight,1 ,5000)
  light = new three.AmbientLight(0x404040, 100)
  scene.add(light)

  renderer = new three.WebGLRenderer({antialias:true})
  renderer.setSize(window.innerWidth, window.innerHeight)
  document.body.appendChild(renderer.domElement)

  let loader = new GLTFLoader()
  loader.load('../public/abarth131/abarth131.gltf', (gltf) => {
    scene.add(gltf.scene)
    renderer.render(scene,camera)
  })
}
init()

Im developing with Vite, in vanilla JS (sorry if my english is weird, i speak spanish)
Any help will be received!

Can you drag the abarth131.gltf onto here:

and verify that it looks correct?

Your code looks mostly correct… but the camera starts at .position(0,0,0) so it might be right in the middle of your loaded object.

Yes it works in GLTFViewer, but not in my proyect

change this line

loader.load('../public/abarth131/abarth131.gltf', (gltf) => {

to

loader.load('abarth131/abarth131.gltf', (gltf) => {