3 ms·
Strict mode is forced in modules, while you need to "use strict" in scripts. That might explain it.
by tentacleuno 5y ago
Strict mode is forced in modules, while you need to "use strict" in scripts. That might explain it.
- jkrems 5y agoIt'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).