diff --git a/ext/js/core/utilities.js b/ext/js/core/utilities.js index ad14802a5..62f48793d 100644 --- a/ext/js/core/utilities.js +++ b/ext/js/core/utilities.js @@ -293,6 +293,10 @@ export function addScopeToCss(css, scopeSelector) { */ export function addScopeToCssLegacy(css, scopeSelector) { const stylesheet = new CSSStyleSheet(); + // nodejs must fall back to the normal version of the function + if (typeof stylesheet.replaceSync === 'undefined') { + return addScopeToCss(css, scopeSelector); + } stylesheet.replaceSync(css); const newCSSRules = []; for (const cssRule of stylesheet.cssRules) {