DOM runtime
DOM runtime in the Diagnostics reference guide.
Raised by @shadow-js/web in the browser.
UNSAFE_URL_BLOCKED#
Warning, once per module instance (web has no public reset). A URL attribute (href, src, action, formaction, xlink:href, srcdoc, poster, data) was given a value that, after removing control characters and whitespace and lower-casing, starts with javascript:, data:text/html or vbscript:. The attribute is not written. useHead tags are checked the same way. The server renderer applies the same rule silently and writes nothing.
Fix: never pass untrusted strings straight to a URL attribute; allow-list the scheme first.
INVALID_ATTRIBUTE_NAME#
Error (TypeError, thrown). An attribute name that cannot appear in markup reached setAttribute, setAttributeNS, setBoolAttribute or, on the server, ssrAttribute / ssrElement. Valid names match ^[A-Za-z_:][A-Za-z0-9_:.-]*$. It happens when object keys from user data are spread onto an element (<div {...data} />): names with spaces, quotes or @ are refused instead of being written into markup. In production the message is SHADOW_INVALID_ATTRIBUTE_NAME: "<name>".
Fix: spread only keys you control, or filter them first.
The server-side variant of the same code is tested under Server rendering.
DUPLICATE_CLASS_ATTRIBUTE#
Warning. One element carries both class and className (or class twice). Both compile to the class attribute, the HTML parser keeps the first and drops the rest, so the second set of classes never applies. Fix: keep one, and join the class names into it.
HYDRATION_KEY_MISS#
Warning, every time it happens (not deduplicated). During hydrate() the client asked for the server element with a given key and the server HTML has none. The client creates the node itself, so the page still works, but the server's work for that part is wasted. Causes: the client rendered a different tree than the server (a branch chosen by isServer, window, localStorage, time or randomness), a different renderId, or HTML that was cached from an older build. Keys are explained in hydration keys.
Fix: render the same components in the same order on both sides; defer client-only content to onMount.
HEAD_OUTSIDE_OWNER#
Warning, every call. useHead() ran with no current owner, so nothing was registered (a head tag must be removed when its owner is disposed). Fix: call useHead inside a component or createRoot.
PORTAL_TARGET_MISSING#
Warning, once per Portal. Portal has no mount element: mount was null, undefined from a function, or document.getElementById(...) found nothing. The portal renders nothing. Fix: make sure the element exists when the portal is created, pass a function that returns it later, or omit mount to render into document.body.