У меня есть простая функция, которая использует ax ios для вызова API. Он вызывается несколько раз, и через несколько раз я получаю одну и ту же ошибку на каждом из них:
Trace: TypeError [ERR_INVALID_ARG_TYPE]: The "listener" argument must be of type Function. Received type object
at checkListener (events.js:77:11)
at TLSSocket.once (events.js:326:3)
at Object.connect (_tls_wrap.js:1425:13)
at Agent.createConnection (https.js:125:22)
at Agent.createSocket (_http_agent.js:242:26)
at Agent.addRequest (_http_agent.js:201:10)
at new ClientRequest (_http_client.js:276:16)
at Object.request (https.js:309:10)
at RedirectableRequest._performRequest (webpack:///./node_modules/follow-redirects/index.js?:169:24)
at new RedirectableRequest (webpack:///./node_modules/follow-redirects/index.js?:66:8) {
code: 'ERR_INVALID_ARG_TYPE'
}
Я использую Vue в своем приложении для внешнего интерфейса, но эта функция вызывается из NodeJS внутреннего интерфейса.
Ax ios экземпляр:
this.axios = axios.create({
withCredentials: true,
responseType: 'json'
});
Ax ios звонок:
await this.axios({
url: this.url,
method: 'POST',
headers: this.headers,
responseType: 'json',
withCredentials: true,
params: {
input: 'test',
method: method
},
data: callData
});
Спасибо.