diff --git a/src/HtmlUtils.tsx b/src/HtmlUtils.tsx
index c781efd8c6..f2c2652280 100644
--- a/src/HtmlUtils.tsx
+++ b/src/HtmlUtils.tsx
@@ -31,7 +31,7 @@ import katex from 'katex';
import { AllHtmlEntities } from 'html-entities';
import SettingsStore from './settings/SettingsStore';
import cheerio from 'cheerio';
-import htmlparser2 from 'htmlparser2';
+import * as htmlparser2 from 'htmlparser2';
import {tryTransformPermalinkToLocalHref} from "./utils/permalinks/Permalinks";
import {SHORTCODE_TO_EMOJI, getEmojiFromUnicode} from "./emoji";
diff --git a/src/editor/serialize.ts b/src/editor/serialize.ts
index d8005bc162..5db53064d5 100644
--- a/src/editor/serialize.ts
+++ b/src/editor/serialize.ts
@@ -22,7 +22,7 @@ import { AllHtmlEntities } from 'html-entities';
import SettingsStore from '../settings/SettingsStore';
import SdkConfig from '../SdkConfig';
import cheerio from 'cheerio';
-import htmlparser2 from 'htmlparser2';
+import * as htmlparser2 from 'htmlparser2';
export function mdSerialize(model: EditorModel) {
return model.parts.reduce((html, part) => {