Turnstile not working on XHTML pages

What is the name of the domain?

netsec.pappacoda.it

What is the error message?

Uncaught TypeError: a.tagName is undefined

What is the issue you’re encountering

When the page is served as an XHTML page (i.e. with the application/xhtml+xml media type), Turnsite fails to load

What are the steps to reproduce the issue?

Create an HTML document with XML syntax named index.xhtml with the following content, then open it in a browser:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
	<head>
		<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async="" defer=""></script>
	</head>
	<body>
		<form action="/login" method="POST">
			<label>
				Password
				<input type="password" name="password"/>
			</label>
			<div class="cf-turnstile" data-sitekey="1x00000000000000000000AA"></div>
			<button>Submit</button>
		</form>
	</body>
</html>

Opening the same exact document but with a filename ending in .html works as expected.