Not all libraries are bundled to support ESM in this way as a single file. If it does not, you can add compile the dependency to support it, as we'll touch on later. The script.js file above works in-browser, but doesn't look quite right to anyone that's done modern JS.
Full article