diff --git a/backend/src/plugins/Utility.ts b/backend/src/plugins/Utility.ts index a3f7a39f..68ebf064 100644 --- a/backend/src/plugins/Utility.ts +++ b/backend/src/plugins/Utility.ts @@ -66,6 +66,14 @@ import fs from "fs"; import sharp from "sharp"; import twemoji from "twemoji"; +declare global { + // This is here so TypeScript doesn't give an error when importing twemoji + // since one of the signatures of twemoji.parse() takes an HTMLElement but + // we're not in a browser environment so including the DOM lib would not make + // sense + type HTMLElement = unknown; +} + import { Url, URL, URLSearchParams } from "url"; const ConfigSchema = t.type({ can_roles: t.boolean, diff --git a/backend/tsconfig.json b/backend/tsconfig.json index 26db7ca1..84c78116 100644 --- a/backend/tsconfig.json +++ b/backend/tsconfig.json @@ -8,8 +8,7 @@ "emitDecoratorMetadata": true, "target": "es2018", "lib": [ - "esnext", - "DOM" + "esnext" ], "baseUrl": ".", "resolveJsonModule": true,