Skip to content

Commit

Permalink
Friendly message for when mount point doesn't exists (#306)
Browse files Browse the repository at this point in the history
* Update client.js

* Update client.js

* Update client.js
  • Loading branch information
titoBouzout authored Jan 22, 2024
1 parent 615b83b commit 693da2b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/dom-expressions/src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ export {
};

export function render(code, element, init, options = {}) {
if(!element && "_DX_DEV_") {
throw new Error(
"The `element` passed to `render(..., element)` doesn't exist in the document. Make sure `element` exists in the document."
);
}
let disposer;
root(dispose => {
disposer = dispose;
Expand Down

0 comments on commit 693da2b

Please sign in to comment.