From 2a48e2618da4097e66ff4bdf48d0ae14ca897046 Mon Sep 17 00:00:00 2001 From: Raphael <66886932+raphaelobinna@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:17:16 +0200 Subject: [PATCH] Update MicrosoftTranslator.js to fix xmldom could not be found within the project or in these directories Due to recent update to xmldom. https://www.npmjs.com/package/@xmldom/xmldom. The line 'const DOMParser = require('xmldom').DOMParser' gives an error 'xmldom could not be found within the project or in these directories' --- src/services/MicrosoftTranslator.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/services/MicrosoftTranslator.js b/src/services/MicrosoftTranslator.js index 489a170..20aa8e7 100644 --- a/src/services/MicrosoftTranslator.js +++ b/src/services/MicrosoftTranslator.js @@ -2,8 +2,7 @@ import HTTPMethods from './HTTPMethods'; import { MICROSOFT } from '../Constants'; import BaseTranslator from './BaseTranslator'; import htmlEntities from './HtmlUtility'; - -const DOMParser = require('xmldom').DOMParser; +import { DOMParser } from '@xmldom/xmldom' export default class MicrosoftTranslator extends BaseTranslator { config;