css-purge icon indicating copy to clipboard operation
css-purge copied to clipboard

DOMException [SyntaxError]: 'undefined' is not a valid selector

Open EVCV opened this issue 2 years ago • 0 comments

When running css purge I was using the following:

css-purge -i "assets/styles/theme-ph.css, assets/styles/webmail.css, assets/styles/skin.css, assets/styles/jquery-ui.css " -o main.min.css -m "index.html, wordpress/index.html, website-builder/index.html, terms-and-conditions/index.html, vps/index.html, privacy-policy/index.html, new-page.html, managed-vps/index.html, hosting/index.html, login/index.html, gdpr/index.html, faqs/index.html, domain/index.html, contact/index.html, certificates/index.html, cdn/index.html, about/index.html, affiliates/index.html, free-hosting/index.html, services/index.html, legal/index.html, legal/complaints/index.html"

it spat out this error:

C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:567
        throw err;
        ^
DOMException [SyntaxError]: 'undefined' is not a valid selector
    at emit (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:565:17)
    at compileSelector (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:1305:11)
    at compileSelector (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:1033:30)
    at compile (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:753:16)
    at collect (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:1553:24)
    at _querySelectorAll (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:1518:36)
    at Object._querySelector [as first] (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\nwsapi\src\nwsapi.js:1424:14)
    at DocumentImpl.<anonymous> (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\jsdom\lib\jsdom\living\nodes\ParentNode-impl.js:65:42)
    at DocumentImpl.querySelector (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\jsdom\lib\jsdom\utils.js:123:45)
    at Document.querySelector (C:\Users\rchow\AppData\Roaming\npm\node_modules\css-purge\node_modules\jsdom\lib\jsdom\living\generated\Document.js:689:45)

Going to the file listed here is the code

  // centralized error and exceptions handling
  emit =
    function(message, proto) {
      var err;
      if (Config.VERBOSITY) {
        if (proto) {
          err = new proto(message);
        } else {
          err = new global.DOMException(message, 'SyntaxError');
        }
        throw err;
      }
      if (Config.LOGERRORS && console && console.log) {
        console.log(message);
      }
    },

EVCV avatar Apr 15 '22 10:04 EVCV