From f0722e23c91b71d20b1bbabea60f7e5bf21f87ac Mon Sep 17 00:00:00 2001 From: matt blickem Date: Fri, 5 Apr 2024 11:50:30 +0200 Subject: [PATCH 1/2] fix: nodejs import/require --- package.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package.json b/package.json index df5a5965..27e627d7 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,12 @@ "browser": "dist/strophe.umd.js", "module": "dist/strophe.esm.js", "unpkg": "dist/strophe.umd.min.js", + "exports": { + "node": { + "import": "./dist/strophe.esm.js", + "require": "./dist/strophe.common.js" + } + }, "scripts": { "types": "tsc", "build": "rollup -c", From 1cef53b9b3fe02bf0069b4fff420c41364b61866 Mon Sep 17 00:00:00 2001 From: matt blickem Date: Fri, 5 Apr 2024 11:54:57 +0200 Subject: [PATCH 2/2] fix: querySelector not implemented by xmldom --- src/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request.js b/src/request.js index f39c969d..979fdae0 100644 --- a/src/request.js +++ b/src/request.js @@ -71,7 +71,7 @@ class Request { log.debug('Got responseText but no responseXML; attempting to parse it with DOMParser...'); node = new DOMParser().parseFromString(this.xhr.responseText, 'application/xml').documentElement; - const parserError = node?.querySelector('parsererror'); + const parserError = node?.getElementsByTagName('parsererror').item(0); if (!node || parserError) { if (parserError) { log.error('invalid response received: ' + parserError.textContent);