{"record":{"id":"8e60ac57846a0a7e","repo":"nodejs/node","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"deps/undici/src/lib/dispatcher/dispatcher.js","lineNumber":6,"sourceCode":"'use strict'\nconst EventEmitter = require('node:events')\n\nclass Dispatcher extends EventEmitter {\n  dispatch () {\n    throw new Error('not implemented')\n  }\n\n  close () {\n    throw new Error('not implemented')\n  }\n\n  destroy () {\n    throw new Error('not implemented')\n  }\n\n  compose (...args) {\n    // So we handle [interceptor1, interceptor2] or interceptor1, interceptor2, ...\n    const interceptors = Array.isArray(args[0]) ? args[0] : args\n    let dispatch = this.dispatch.bind(this)\n\n    for (const interceptor of interceptors) {\n      if (interceptor == null) {\n        continue","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/undici/src/lib/dispatcher/dispatcher.js#L1-L24","documentation":"Generic Error('not implemented') thrown by the abstract Dispatcher.dispatch() base method. The base Dispatcher class (dispatcher.js) is an abstract superclass; dispatch() must be overridden by a concrete subclass (DispatcherBase, Client, Pool, Agent). Instantiating the base Dispatcher directly, or subclassing it without overriding dispatch(), produces this on the first call.","triggerScenarios":"Calling `dispatch()` on a `new Dispatcher()` instance, or on a custom subclass of Dispatcher (not DispatcherBase) that does not override dispatch(). Fires at dispatcher.js:5-6.","commonSituations":"Directly requiring and instantiating the base Dispatcher class; writing a custom interceptor/agent that extends Dispatcher instead of DispatcherBase and forgets to implement dispatch; mock/stub objects that extend the base for typing.","solutions":["Use a concrete dispatcher: Client, Pool, Agent, or BalancedPool.","If subclassing, extend DispatcherBase (which provides dispatch/close/destroy plumbing) or implement dispatch() yourself.","For custom dispatch logic, use compose(interceptors) on a real dispatcher instead of subclassing the base."],"exampleFix":"// before\nconst Dispatcher = require('undici/lib/dispatcher/dispatcher')\nconst d = new Dispatcher()\nd.dispatch(opts, handler) // throws\n// after\nconst { Client } = require('undici')\nconst client = new Client(url)\nclient.dispatch(opts, handler)","handlingStrategy":"validation","validationCode":"function isConcreteDispatcher(d) {\n  return !!d && typeof d.dispatch === 'function' && d.dispatch !== require('undici/lib/dispatcher/dispatcher').prototype.dispatch;\n}","typeGuard":"dispatcher instanceof DispatcherBase","tryCatchPattern":null,"preventionTips":["Never instantiate the base Dispatcher class directly.","Use Client/Pool/Agent, or extend DispatcherBase for custom dispatchers.","Use compose(interceptors) for custom dispatch behavior instead of subclassing."],"tags":["undici","dispatcher","abstract","api-misuse","not-implemented"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}