You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewError(`UnCSS: could not open ${path.join(process.cwd(),filename)}`);
Starting in v0.17.2 I get errors from jsdom similar to (v0.17.3 output shown):
Error: Could not load script: "static/script.js"
at onErrorWrapped (.../node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js:38:19)
at Object.check (.../node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js:72:23)
at request.then.catch.err (.../node_modules/jsdom/lib/jsdom/browser/resources/resource-queue.js:124:14)
at process._tickCallback (internal/process/next_tick.js:68:7) Error: Tried to fetch invalid URL static/script.js
at CustomResourcesLoader.fetch (.../node_modules/jsdom/lib/jsdom/browser/resources/resource-loader.js:84:29)
at CustomResourcesLoader.fetch (.../node_modules/uncss/src/jsdom.js:62:22)
at PerDocumentResourceLoader.fetch (.../node_modules/jsdom/lib/jsdom/browser/resources/per-document-resource-loader.js:17:42)
at HTMLScriptElementImpl._fetchExternalScript (.../node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:93:30)
at HTMLScriptElementImpl._eval (.../node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:160:12)
at HTMLScriptElementImpl._poppedOffStackOfOpenElements (.../node_modules/jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js:125:10)
at OpenElementStack.JSDOMParse5Adapter.OpenElementStack.pop (.../node_modules/jsdom/lib/jsdom/browser/parser/html.js:45:16)
at Object.endTagInText [as END_TAG_TOKEN] (.../node_modules/parse5/lib/parser/index.js:2153:20)
at Parser._processToken (.../node_modules/parse5/lib/parser/index.js:657:55)
at Parser._processInputToken (.../node_modules/parse5/lib/parser/index.js:684:18)
at Parser._runParsingLoop (.../node_modules/parse5/lib/parser/index.js:440:18)
at Parser.parse (.../node_modules/parse5/lib/parser/index.js:344:14)
at Object.parse (.../node_modules/parse5/lib/index.js:10:19)
at parseIntoDocument (.../node_modules/jsdom/lib/jsdom/browser/parser/html.js:175:17)
at parseIntoDocument (.../node_modules/jsdom/lib/jsdom/browser/parser/index.js:31:10)
at new JSDOM (.../node_modules/jsdom/lib/api.js:45:5)
at Promise (.../node_modules/uncss/src/jsdom.js:94:43)
at new Promise (<anonymous>)
at Object.fromSource (.../node_modules/uncss/src/jsdom.js:89:12)
at Promise.all.files.map (.../node_modules/uncss/src/uncss.js:36:50)
at Array.map (<anonymous>)
at getHTML (.../node_modules/uncss/src/uncss.js:36:30)
at process (.../node_modules/uncss/src/uncss.js:221:12)
at uncss (.../node_modules/uncss/src/uncss.js:213:5)
and this error does not propagate to the callback supplied to uncss, causing strange behavior in my application.
Changing the jsdom options does solve the problem:
Commented on #430 but I'm unsure if it's related or not.
Given some random HTML, where no CSS or JavaScript resources actually exist on disk:
And when calling uncss where I'm passing all real CSS content through
raw
:where
dummy.css
exists completely empty only so there isn't an error here:uncss/src/utility.js
Line 149 in fb9593e
Starting in v0.17.2 I get errors from jsdom similar to (v0.17.3 output shown):
and this error does not propagate to the callback supplied to uncss, causing strange behavior in my application.
Changing the jsdom options does solve the problem:
but that doesn't fix my tests that were passing even though there was an error that didn't propagate.
The text was updated successfully, but these errors were encountered: