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
dns interceptor does not implements the deleteRecord function but used it,so a typeError will be triggered when ENOTFOUND.
I have searched the keyword deleteRecord but there is no any implements or type declare, maybe it's a dead code?
// undici source code lib/interceptor/dns.js:263
Reproducible By
Reproducible code:
// undici version:latest,I used 7.1.1const{ Client, interceptors }=require('undici');const{ dns }=interceptors;// x.y.z is a unavailable serverconstclient=newClient('http://x.y.z');constdnsItp=dns({lookup(hostname,options,callback){callback(null,[{address: '127.0.0.1',family: 4,ttl: 0,},]);},});constclient2=client.compose(dnsItp);(async()=>{try{awaitclient2.request({path: '/',method: 'GET',origin: 'https://x.y.z'});}catch(e){console.log('#error',e);}})();
Expected Behavior
Catch error or request success, depends on the server in localhost.
Logs & Screenshots
/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/interceptor/dns.js:264
this.#state.deleteRecord(this.#origin)
^
TypeError: this[#state].deleteRecord is not a function
at DNSDispatchHandler.onResponseError (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/interceptor/dns.js:264:21)
at UnwrapHandler.onError (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/handler/unwrap-handler.js:94:36)
at Request.onError (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/core/request.js:301:27)
at Object.errorRequest (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/core/util.js:828:13)
at onError (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/dispatcher/client.js:371:12)
at connect (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/dispatcher/client.js:502:7)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Emitted 'error' event on Client instance at:
at Object.errorRequest (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/core/util.js:831:12)
at onError (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/dispatcher/client.js:371:12)
at connect (/private/var/folders/_c/nmt7v77j62749m7k6nr380_00000gq/T/tmp.yxci1cuDUW/node_modules/undici/lib/dispatcher/client.js:502:7)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Environment
Node.js v22.11.0
MacOS 15.2 with Apple Silicon M3
Additional context
The text was updated successfully, but these errors were encountered:
EAGzzyCSL
changed the title
TypeError: this[#state].deleteRecord is not a function
TypeError: this[#state].deleteRecord is not a function in builtin dns interceptor
Dec 18, 2024
Bug Description
dns interceptor does not implements the
deleteRecord
function but used it,so a typeError will be triggered whenENOTFOUND
.I have searched the keyword
deleteRecord
but there is no any implements or type declare, maybe it's a dead code?// undici source code lib/interceptor/dns.js:263
Reproducible By
Reproducible code:
Expected Behavior
Catch error or request success, depends on the server in localhost.
Logs & Screenshots
Environment
Additional context
The text was updated successfully, but these errors were encountered: