Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created June 9, 2022 23:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/a8cb14999393916ab4a8c3af74fd4221 to your computer and use it in GitHub Desktop.
Save nolanlawson/a8cb14999393916ab4a8c3af74fd4221 to your computer and use it in GitHub Desktop.
Repro Chrome whenDefined issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Repro Chrome whenDefined issue</title>
</head>
<body>
<h1>Repro Chrome whenDefined issue</h1>
<pre id="display"></pre>
<script>
customElements.define('x-foo', class MyElement extends HTMLElement {})
customElements.whenDefined('x-foo').then(Ctor => {
display.innerHTML = `Constructor: ${Ctor}`
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment