TypeError [ERR_INVALID_ARG_TYPE]: The "options.lookup" property must be of type function. Received null
See original GitHub issueOS: Windows 10 21H2 19044.1469
superagent: 7.1.0
package.json
{
...
"dependencies": {
"superagent": "^7.1.0"
},
...
}
test.js
const { get } = require('superagent')
get("http://www.baidu.com", (err, res) => {
if (err) throw err
console.log(res.statusCode)
})
output:
$ node .\test.js ─╯
node:internal/validators:237
throw new ERR_INVALID_ARG_TYPE(name, 'Function', value);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "options.lookup" property must be of type function. Received null
at lookupAndConnect (node:net:1032:5)
at Socket.connect (node:net:989:5)
at Agent.connect [as createConnection] (node:net:203:17)
at Agent.createSocket (node:_http_agent:341:26)
at Agent.addRequest (node:_http_agent:292:10)
at new ClientRequest (node:_http_client:305:16)
at Object.request (node:http:96:10)
at Request.request (K:\git\live-stream\node_modules\superagent\lib\node\index.js:833:18)
at Request.end (K:\git\live-stream\node_modules\superagent\lib\node\index.js:989:8)
at request.<computed> (K:\git\live-stream\node_modules\superagent\lib\node\index.js:1371:24) {
code: 'ERR_INVALID_ARG_TYPE'
}
After downgrading to 6.1.0
there is no such issue:
$ node .\test.js
200
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:6
Top Results From Across the Web
ERR_INVALID_ARG_TYPE · Issue #22630 · nodejs/node
TypeError [ERR_INVALID_ARG_TYPE]: The "options.cwd" property must be of type string. Received function wrappedCwd
Read more >The "path" argument must be of type string ... - Stack Overflow
I'm working on a project in React and ran into a problem that has me stumped. Whenever I run yarn start I get...
Read more >typeerror [err_invalid_arg_type]: the "data" argument must be ...
I get this error - TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be of type string or an instance of Buffer, TypedArray, DataView, or...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument ...
AssertionError: TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
v7.1.1 published
https://github.com/visionmedia/superagent/releases/tag/v7.1.1
Thank goodness for this. I’ve been racking my brain trying to work out what’s going on today, where using a local version of a package was fine but the npm version was failing. Was just about to give up when I saw the npm WARN.