Hacker News new | ask | show | jobs
by tentacleuno 1562 days ago
Strict mode is forced in modules, while you need to "use strict" in scripts. That might explain it.
1 comments

It's actually not related to strict mode. HTML comments work fine in strict mode as well as sloppy mode in scripts. The difference here is that modules are a different file format / syntax and they fundamentally don't include parts of the syntax that was supported in the older script file format (and vice versa: they allow syntax like top-level await that wasn't/isn't valid in the script file format).