Closed binomialstew closed 6 years ago
I'm experiencing something very close to this. I'm similarly able to run fine with no issues with karma-phantomjs-launcher
(latest, 1.0.4) but failing when using karma-jsdom-launcher
. I'm running from Windows (7 Pro) PowerShell, my installed versions are:
node: 8.11.2
karma: 1.7.1
karma-jsdom-launcher: 6.1.3
jsdom: 11.12.0
```sh PS C:\Users\..path\to\app> npm t > cfc-vendor-lib@1.0.0 test C:\Users\..path\to\app > karma start karma.conf.js [2018-08-10 13:43:36.084] [INFO] karma - Karma v1.7.1 server started at http://0.0.0.0:9876/ [2018-08-10 13:43:36.085] [INFO] launcher - Launching browser jsdom with unlimited concurrency [2018-08-10 13:43:36.103] [INFO] launcher - Starting browser jsdom [2018-08-10 13:43:36.228] [ERROR] karma - Error: "value" required in setHeader("Referer", value) at validateHeader (_http_outgoing.js:489:11) at ClientRequest.setHeader (_http_outgoing.js:498:3) at new ClientRequest (_http_client.js:173:14) at Object.request (http.js:38:10) at Request.start (C:\Users\..path\to\app\node_modules\request\request.js:708:30) at Request.end (C:\Users\..path\to\app\node_modules\request\request.js:1405:28) at end (C:\Users\..path\to\app\node_modules\request\request.js:433:16) at C:\Users\..path\to\app\node_modules\request\request.js:447:9 at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) npm ERR! Test failed. See above for more details. ```
@binomialstew, I will try to have a look at this as soon as I can.
@edm00se, when one does change from EG. phantomjs to jsdom, you also change request implementation. That of webkit (phantomjs) might be more lenient than jsdom, thus allowing you to actually specify a blank referrer. Are you doing anything like that?
@badeball I'm not doing anything (myself) with referrers or anything, pretty basic tests in fact.
I found that this seems to be related to the request
dependency of jsdom. Pinning request
to version 2.83
corrects the problem for me.
@binomialstew, I'll assume that to be correct for now and thus consider this to be solved.
If the issues persist - I encourage people to try to provide a minimal example to re-produce the issue. Preferably with a full package-lock, to ensure that the example continues to produce it.
I have been getting this error intermittently. It started failing again after other seemingly unrelated dependency changes.
If I replace
jsdom
withphantomjs
and its corresponding launcher, my tests run with no issue, and my tests ran with no issue previously with the same configuration I have now using thejsdom
browser andkarma-jsdom-launcher
for at least 6 months.In the past, it seemed like it may have something to do with the node version, but I haven't updated node recently on the system in question.
My current versions:
The first time I saw this error, it was on a remote server with an older node version (6, I believe). This is after it had been running successfully for a while under that version. I was not able to reproduce locally at that time. Now I am seeing it locally, as well. I was unable to find any differences that would explain this between the current state of my dependencies and before, when it was running successfully.