You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since upgrading to axios@1.4.0, our usage of cacheable-lookup stopped working. I have identified that this change is the cause.
The reason is because the lookup option is now explicitly included in the options object, set to the undefined value. This is propagated through all the way to the HTTP agent. The cacheable-lookup library naively checks for the presence of the property, rather than if it is set to a usable or expected value, thus causing the problem.
While I believe the fix should be made in cacheable-lookup, however we are unable to upgrade beyond v6 because sindresorhus decided to force everyone to use ESM, and we cannot migrate our whole codebase to support ESM just like that 😓 I imagine others are in the same boat.
I would really appreciate if axios could change the explicit inclusion of lookup to an "if present" style (e.g. ...(lookup ? { lookup } : {}),) to resolve this problem. Of course, I understand if you would prefer not to.
To Reproduce
Install axios@1.4.0 and witness cached DNS is not used.
Describe the bug
Since upgrading to
axios@1.4.0
, our usage ofcacheable-lookup
stopped working. I have identified that this change is the cause.The reason is because the
lookup
option is now explicitly included in the options object, set to theundefined
value. This is propagated through all the way to the HTTP agent. Thecacheable-lookup
library naively checks for the presence of the property, rather than if it is set to a usable or expected value, thus causing the problem.While I believe the fix should be made in
cacheable-lookup
, however we are unable to upgrade beyond v6 because sindresorhus decided to force everyone to use ESM, and we cannot migrate our whole codebase to support ESM just like that 😓 I imagine others are in the same boat.I would really appreciate if
axios
could change the explicit inclusion oflookup
to an "if present" style (e.g....(lookup ? { lookup } : {}),
) to resolve this problem. Of course, I understand if you would prefer not to.To Reproduce
axios@1.4.0
and witness cached DNS is not used.1.3.6
and witness it is used.See code snipped for a test.
Code snippet
Expected behavior
Should always use cached DNS when installed.
Axios Version
1.4.0
Adapter Version
HTTP
Browser
N/A
Browser Version
N/A
Node.js Version
18.12
OS
All?
Additional Library Versions
No response
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: