#Satori-html breaks starting nestjs

5 messages · Page 1 of 1 (latest)

full summit
#

Hello, we are trying to convert a html string to svg and then from svg to png with this satori, satori-html and resvg

we followed this blog: https://anasrar.github.io/blog/generate-image-from-html-using-satori-and-resvg/

But after adding

import satori from "satori";
import { html } from "satori-html";
import { Body, Controller, Post } from "@nestjs/common";

@Controller()
export class AppController {
  @Post("test")
  @Public()
  async test(@Body() body: any) {
      const markup = html(`<div style="color: black;">hello, world</div>`);
      const svg = await satori(markup, {
        width: 600,
        height: 400,
        fonts: []
      });
  }
}

it seems to break our api completely as it is stuck in:

[3:55:40 PM] File change detected. Starting incremental compilation...

[3:55:41 PM] Found 0 errors. Watching for file changes.

on removing the html(...) part the api starts again.

Anas Rin

TL;DR Generate image from HTML using github.com/vercel/satori (to convert HTML to SVG) and github.com/yisibl/resvg-js (to convert SVG to PNG) on Node.js and...

near shore
full summit
#

I am on mac. we start with nest start api --watch

short sailBOT
#

nestjs Common errors - "File change detected" loops endlessly

near shore
#

No idea what the issue is, hope that helps