Issue with @materiel/web ESM, seems to be loading a file twice. [esm-raw]
Author: treederCreated Apr 5, 2023Updated Jun 27, 2026
Describe the bug
If I import two files from this package like this:
<html>
<body>
<script type="module">
import 'https://cdn.jsdelivr.net/npm/@material/[email protected]/navigationtab/navigation-tab.js/+esm'
import 'https://cdn.jsdelivr.net/npm/@material/[email protected]/button/filled-button.js/+esm'
</script>
<h1>Hi</h1>
</body>
</html>I get this error:
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "md-focus-ring" has already been used with this registryWhich implies that the md-focus-ring is being defined more than once. That registration can be found here: https://cdn.jsdelivr.net/npm/@material/[email protected]/focus/focus-ring.js
For what it's worth, unpkg seems to not have this issue.
Source: jsdelivr/jsdelivr