Skip to content

http core module issue #9069

Description

@the1mills

on Node.js 6.7

I got this while using require('http').request()

[accounts.api.test.js]  stack: TypeError: self.agent.addRequest is not a function
[accounts.api.test.js]     at new ClientRequest (_http_client.js:158:16)
[accounts.api.test.js]     at Object.exports.request (http.js:31:10)
[accounts.api.test.js]     at Object.makeHTTPRequest [as httpHelper] (/Users/t_millal/WebstormProjects/autodesk/crucible-poc-discovery/test/helpers/http-helper.js:22:20)
[accounts.api.test.js]     at TestSuiteBase.it.cb.t (/Users/t_millal/WebstormProjects/autodesk/crucible-poc-discovery/test/test-src/accounts.api.test.js:27:17)
[accounts.api.test.js]     at /Users/t_millal/WebstormProjects/oresoftware/suman/lib/test-suite-helpers/handle-test.js:191:37
[accounts.api.test.js]     at _combinedTickCallback (internal/process/next_tick.js:67:7)
[accounts.api.test.js]     at process._tickDomainCallback (internal/process/next_tick.js:122:9)

probably shouldn't be happening no matter what the input data is, but here it is:


[accounts.api.test.js]  => request d => 
[accounts.api.test.js]  { host: 'localhost',
[accounts.api.test.js]   port: 3001,
[accounts.api.test.js]   path: '/api/Accounts',
[accounts.api.test.js]   method: 'GET',
[accounts.api.test.js]   agent: true,   <<< seems to be culprit
[accounts.api.test.js]   headers: { 'Content-Type': 'application/json' } }

curious as to what might be happening thanks, setting agent to false, will prevent this error being thrown...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.httpIssues and PRs related to the http subsystem.questionIssues asking questions about Node.js.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions