It seems you have to add type="module" to your script tag that contains your application code.
type="module"
script