Im making my 1st snake game getting syntax error uncaught syntaxerror cannot use import statement outside a module
game.js import { update as updateSnake, draw as drawSnake, SNAKE_SPEED } from "/.snake.js" let lastRenderTime = 0 const SNAKE_SPEED = 2 function main(currentTime) { const secondsSinceLastRender = (currentTime - lastRenderTime) / 1000 if secondsSinceLastRender < 1 / SNAKE_SPEED return window.requestAnimationFrame(main) console.log("Render") lastRenderTime = currentTime; update() draw() } window.requestAnimationFrame(main) function update(){ updateSnake() } functuon draw(){ drawSnake() } snake.js export const SNAKE_SPEED = 1 const snakeBody = [{x: 11, y: 11}] export function update() { console.log("update snake") } export function draw(gameBoard) { snakeBody.forEach(segment => { const snakeElement = document.createElement("div") snakeElement.style.gridRowStart = segment.x snakeElement.style.gridColumnStart = segment.y }) }