axios 错误[内部Assert错误]:类型错误[错误_无效_此]:this”的值必须为EventTarget类型

m2xkgtsf  于 2022-12-23  发布在  iOS
关注(0)|答案(1)|浏览(198)

在任何API调用中获取ERR_INVALID_THIS,有时有效,有时无效,

error:
{name: 'Error', message: 'TypeError [ERR_INVALID_THIS]: Value of "this…ce at https://github.com/nodejs/node/issues\n', stack: 'Error [ERR_INTERNAL_ASSERTION]: TypeError [ER…og (node:internal/console/constructor:360:61)', code: 'ERR_INTERNAL_ASSERTION'}
code:
'ERR_INTERNAL_ASSERTION'
message:
'TypeError [ERR_INVALID_THIS]: Value of "this" must be of type EventTarget\n    at new NodeError (node:internal/errors:372:5)\n    at EventTarget.[nodejs.util.inspect.custom] (node:internal/event_target:666:13)\n    at formatValue (node:internal/util/inspect:782:19)\n    at formatProperty (node:internal/util/inspect:1819:11)\n    at formatRaw (node:internal/util/inspect:1030:9)\n    at formatValue (node:internal/util/inspect:817:10)\n    at inspect (node:internal/util/inspect:347:10)\n    at formatWithOptionsInternal (node:internal/util/inspect:2167:40)\n    at formatWithOptions (node:internal/util/inspect:2029:10)\n    at console.value (node:internal/console/constructor:324:14)\nThis is caused by either a bug in Node.js or incorrect usage of Node.js internals.\nPlease open an issue with this stack trace at https://github.com/nodejs/node/issues\n'
name:
'Error'
stack:
'Error [ERR_INTERNAL_ASSERTION]: TypeError [ERR_INVALID_THIS]: Value of "this" must be of type EventTarget\n    at new NodeError (node:internal/errors:372:5)\n
rjzwgtxy

rjzwgtxy1#

每当我在VS代码和console.log(error)中启用调试器时,我有时也会遇到这个问题。它与任何库都无关,只是因为您在consol.log()或warn函数中使用了大量参数,因为axios error在错误中返回了大量配置文件

相关问题