It seems like the solution is not difficult, just something obvious.
I am working on a simple TypeScript project. There are no modules involved, only TypeScript for compilation. The TS files compile into JS files in the dist folder, which are then connected in app.js (you can see the project structure in the photo).
After compiling the files, there are no errors, but the browser cannot find the imported files until I change this:
import { ProjectList } from "./components/project-list";
to this:
import { ProjectList } from "./components/project-list.js";
in the compiled JS files.
Why doesn't it work without '.js'!?
In index.js, I specify script type="module". https://i.sstatic.net/AlbLC.png https://i.sstatic.net/fnaZU.png