Ask coding questions

← Back to all posts
type=“module” not executing script
h
Jackbaklava (40)

Hello everyone!

So I was making a kaboomjs game and decided to split my scenes into different files, which meant that I had to use import statements and then type=“module” in index.html. However, the script simply does not execute. I have faced this problem before but still don’t know how to fix it. (I am using safari on my phone).

Any help would be appreciated!

Comments
hotnewtop
adityavengata (18)

Make sure you check your browser console (In inspect element)
It shows this:
Uncaught TypeError: Failed to resolve module specifier "kaboom.js". Relative references must start with either "/", "./", or "../".

Jackbaklava (40)

@adityavengata But now that I haved fixed the file path, the script still doesn’t execute.

QuickV (130)

Console says: "Relative references must start with either "/", "./", or "../".
at /" I have no idea what that means though.

Jackbaklava (40)

@QuickV 🧐, for me the console doesn’t say anything but the process just terminates, interesting. What browser are you using?

QuickV (130)

Ah... I'm using chrome... @Jackbaklava