KonnorRogers/rhino-editor

Uncaught DOMException: Failed to construct 'CustomElement': The result must not have children

Closed this issue · 8 comments

We've followed your getting started docs for Rails, and have been able to repeat our problem on a super simple HTML page:

<!DOCTYPE html>
<html>
<head>
<title>Simple Layout</title>
<meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="k-G8G-RA2J_rvLXmpvnak6dL54j5KY8Z5DAZjuzAOF2BEor8Jrwnaop1hdbY2ky4Sasgn3y8XOwGEjqchjkwBg" />

<script src="/assets/application-0c52a859b34d97e02fb9eec6e2051b91a719fa9d66713bfca25f8cbf2ee13403.js" data-turbo-track="reload"></script>
</head>
<body>
<h1>Rhino Editor Test</h1>
<rhino-editor></rhino-editor>

<script async nonce="" type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js"></script>
</body>
</html>

Our application.js file contains only:

// Entry point for the build script in your package.json
import "rhino-editor"
import "./application.scss"
console.log("Hello from JS")

Our application.scss file contains only:

@import "rhino-editor/exports/styles/trix";
body {background:blue;}

But we have not been able to get the editor to load due to the DOMException.

screenshot 33

Any advice would be greatly appreciated!

@nathancolgate thanks! I'll take a look and see what's up.

Also, @nathancolgate are you using importmaps or a bundler?

I've run into this bug in a rails app using esbuild. I also created a simple js project that reproduces the bug - attachnig it in case it is helpful.
rhino_bug.zip

Awesome thanks! This is a huge help.

Well, the good news is this was actually fixed in 0.7.1 (I fixed some of the setup code for light dom elements, and it seems to have fixed the issue)

I was able to reproduce the issue in 0.7.0 with your reproduction (super helpful, thank you again!)

and the issue is gone in 0.7.1

@nathancolgate Mind upgrading to rhino 0.7.1 and giving it a whirl?

I'm going to mark this as closed, feel free to re-open if for some reason the bug is still present!

@KonnorRogers Brilliant! Thanks so much.

screenshot 34

@nathancolgate Awesome! Sorry about that!