By default, <script>
tags are interpreted as regular scripts, not as ES6 modules. Specify the script as a module using the type="module" attribute.
<body>
<-- some html>
</body>
<script type="module">
import fs from "fs";
// some javascript
</script>