Closed
Description
- Check if updating to the latest Preact version resolves the issue
Describe the bug
If we have <!DOCTYPE html>
in our HTML document where we use Preact, and try to render or hydrate a component in the document
, we get an Uncaught DOMException error, and the component does not render/hydrate. Although, it'll be fine if we remove <!DOCTYPE html>
. This is very a strange behavior.
To Reproduce
<!DOCTYPE html>
<html>
<body>
</body>
</html>
<script type="module">
import { h, Component, render } from 'https://unpkg.com/preact?module';
const app = h('html', null, h('body', null, h('h1', null, 'Hello World!')));
render(app, document);
</script>
Steps to reproduce the behavior:
- Open the above HTML in your browser.
- You will face the error.
- Try removing the first line,
<!DOCTYPE html>
. - See how the error is gone.
Expected behavior
Should act just fine :)