diff --git a/src/index.ts b/src/index.ts index 2de59a30..38c2e3b9 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,8 +18,16 @@ export async function toSvg( ): Promise { const { width, height } = getImageSize(node, options) const clonedNode = (await cloneNode(node, options, true)) as HTMLElement - await embedWebFonts(clonedNode, options) - await embedImages(clonedNode, options) + try { + await embedWebFonts(clonedNode, options); + } catch (error) { + console.log('[embedWebFonts error]', error); + } + try { + await embedImages(clonedNode, options); + } catch (error) { + console.log('[embedImages error]', error); + } applyStyle(clonedNode, options) const datauri = await nodeToDataURL(clonedNode, width, height) return datauri