wikimedia / html-metadata

MetaData html scraper and parser for Node.js (supports Promises and callback style)
MIT License
138 stars 44 forks source link

Cannot read property 'connectTimeoutTimer' of undefined #49

Open traviswimer opened 7 years ago

traviswimer commented 7 years ago

I'm getting a strange error that seems to be caused by some conflict between this module and https://github.com/desmondmorris/node-twitter

TypeError: Uncaught error: Cannot read property 'connectTimeoutTimer' of undefined
    at ConnectTimeoutAgent.createSocket (/path/to/project/node_modules/html-metadata/node_modules/preq/index.js:21:46)
    at ConnectTimeoutAgent.Agent.addRequest (_http_agent.js:157:10)
    at new ClientRequest (_http_client.js:160:16)
    at Object.exports.request (http.js:31:10)
    at Object.exports.request (https.js:199:15)
    at Request.start (/path/to/project/node_modules/twitter/node_modules/request/request.js:744:32)
    at Request.write (/path/to/project/node_modules/twitter/node_modules/request/request.js:1421:10)
    at end (/path/to/project/node_modules/twitter/node_modules/request/request.js:551:18)
    at Immediate.<anonymous> (/path/to/project/node_modules/twitter/node_modules/request/request.js:580:7)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
    at processImmediate [as _immediateCallback] (timers.js:582:5)

The strange thing is that this error is thrown when I make a request with node-twitter. It seems html-metadata never actually needs to be used, this error will be thrown if it is simply require-ed.

Sorry if this isn't the right place to post this, but I figured I would start here since I'm not actually sure where the source of this problem is.

d00rman commented 7 years ago

@traviswimer Which version of node and html-metadata are you using? Do you see this error consistently or only for certain requests?