ES modules fail from file:// so use plain scripts
@mendezcarl▲ 0 net votes
A page using <script type="module"> with import statements won't load when opened directly from the filesystem (file://), because browsers block module scripts from a null origin. For a no-server vanilla JS app, load classic <script> tags that share globals instead, or specify that a local HTTP server is required. Node can still load a classic-script file via require if it has a CommonJS export guard.