Skip to content

Commit

Permalink
fix: add awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadreyo committed Mar 6, 2023
1 parent afddc99 commit 14a5e28
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/satori.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import { Resvg } from '@resvg/resvg-js';
// import { html } from "satori-html";

// failed
const html = (...args: string[]) => {
const html = async (...args: string[]) => {
const { html } = await import('satori-html');
// @ts-ignore
import('satori-html').then(({ html }) => html(...args));
return html(...args);
}

export default async function satoriFunc() {
const template = html(`
const template = await html(`
<div style="font-family: Roboto; font-size: 24px; color: #000000;">
<p>Hello World!</p>
</div>
Expand Down

0 comments on commit 14a5e28

Please sign in to comment.