From 809a0b8014666d7258b9cecdf1a865c29bfb7176 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 13 Jan 2025 15:14:07 +0100 Subject: [PATCH] fix empty template error --- package.json | 2 +- src/dom.tools.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index a9ef805..b402233 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lightweight-sdk/web-component", - "version": "0.0.0", + "version": "0.0.1", "description": "A lightweight library to build web components easily", "scripts": { "build": "tsc -b", diff --git a/src/dom.tools.ts b/src/dom.tools.ts index b370e36..e24c15a 100644 --- a/src/dom.tools.ts +++ b/src/dom.tools.ts @@ -21,5 +21,6 @@ export function findRefElement(ref: string, parent?: HTMLElement): HTMLElement | * @returns the template as a string */ export function parseModuleToHtml(mod: any): string { + if (mod == null) return ""; return "default" in mod ? mod.default as string : ""; } \ No newline at end of file