ChrisWren / grunt-link-checker

Run node-simple-crawler to discover broken links on your website
MIT License
33 stars 9 forks source link

Fatal error: "name" and "value" are required for setHeader(). #12

Closed davidshrive closed 9 years ago

davidshrive commented 9 years ago

I'm getting the above error after attempting to set up this plugin. These are what my files look like...

Gruntfile.js

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        'link-checker': { 
            dev: {
                site: 'http://www.website.com',
                options: {
                    maxConcurrency: 20,
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-link-checker');

    grunt.registerTask('default', ['link-checker']);

};

package.json

{
  "name": "Website-Link-Crawler",
  "version": "0.0.1",
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-link-checker": "0.0.6"
  }
}
ChrisWren commented 9 years ago

Could you add the complete stack trace output from your terminal?

itsjesseyo commented 9 years ago

I have the same issue. that is the entire stack trace...

(mike)ITAdmins-iMac-2:grunt_test jgomez$ grunt Running "link-checker:dev" (link-checker) task

Checking for broken links at: https://github.com/cgiffard/node-simplecrawler#configuring-the-crawler Fatal error: "name" and "value" are required for setHeader().

irishgordo commented 9 years ago

I see the same thing

ChrisWren commented 9 years ago

Seems to be an issue in node 0.12 and io.js which is not present in node 0.10.

ChrisWren commented 9 years ago

node-simplecrawler isn't being tested on node 0.12 and io.js.

Fatal error: "name" and "value" are required for setHeader().
Error: "name" and "value" are required for setHeader().
    at ClientRequest.OutgoingMessage.setHeader (_http_outgoing.js:333:11)
    at new ClientRequest (_http_client.js:101:14)
    at Object.exports.request (http.js:49:10)
    at /Users/chriswren/code/grunt-link-checker/node_modules/simplecrawler/lib/crawler.js:768:11
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
XhmikosR commented 9 years ago

Maybe a first step would be an upstream PR for this?

ChrisWren commented 9 years ago

That sounds good. I am not actively using this right now, so I am not going to jump in and fix it, but I will review PRs.

XhmikosR commented 9 years ago

I couldn't find why it fails, but I can at least submit a PR upstream to add node.js 0.12 in Travis.

XhmikosR commented 9 years ago

PR submitted https://github.com/cgiffard/node-simplecrawler/pull/119

Tests seem to pass there :/

cgiffard commented 9 years ago

I've fixed this upstream. Should (hopefully) be just a matter of updating the dependency. :)

XhmikosR commented 9 years ago

Awesome, I can confirm it's fixed now!

ChrisWren commented 9 years ago

Great, thanks for the patch @cgiffard!