When executing replace(), the root fragment needs to exist in the DOM else it throws an error.
Expected Behavior
Given this html:
<body>
<main></main>
</body>
And this JSX:
replace(
<main id="app">
<h1>hello world</h1>
</main>
)
The expectation would be that the function would either fail silently, or emit a warning with a description of what went wrong. At the very least, it should not halt execution of the program.
Observed Behavior
It throws the following uncaught exception:
Uncaught TypeError: Cannot read properties of null (reading 'replaceChildren')
When executing
replace(), the root fragment needs to exist in the DOM else it throws an error.Expected Behavior
Given this html:
And this JSX:
The expectation would be that the function would either fail silently, or emit a warning with a description of what went wrong. At the very least, it should not halt execution of the program.
Observed Behavior
It throws the following uncaught exception: