{"record":{"id":"9f67f81c11c205d6","repo":"denoland/deno","slug":"err-not-implemented","errorCode":"ERR_NOT_IMPLEMENTED","errorMessage":"Not implemented: ${msg}","messagePattern":"Not implemented: (.+?)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/_utils.ts","lineNumber":46,"sourceCode":"\ntype BinaryEncodings = \"binary\";\n\ntype TextEncodings =\n  | \"ascii\"\n  | \"utf8\"\n  | \"utf-8\"\n  | \"utf16le\"\n  | \"ucs2\"\n  | \"ucs-2\"\n  | \"base64\"\n  | \"base64url\"\n  | \"latin1\"\n  | \"hex\";\n\ntype Encodings = BinaryEncodings | TextEncodings;\n\nfunction notImplemented(msg: string): never {\n  throw new ERR_NOT_IMPLEMENTED(msg);\n}\n\nfunction warnNotImplemented(msg?: string) {\n  const message = msg\n    ? `Warning: Not implemented: ${msg}`\n    : \"Warning: Not implemented\";\n  // deno-lint-ignore no-console\n  console.warn(message);\n}\n\ntype _TextDecoder = typeof TextDecoder.prototype;\nconst _TextDecoder = TextDecoder;\n\ntype _TextEncoder = typeof TextEncoder.prototype;\nconst _TextEncoder = TextEncoder;\n\n// API helpers\n","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/denoland/deno/blob/89f33cbef296a2b287f323d42de54c871fa69c77/ext/node/polyfills/_utils.ts#L28-L64","documentation":"This is Deno's node-compatibility shim for APIs that exist in Node but have no Deno implementation (ext/node/polyfills/_utils.ts:46). notImplemented(msg) throws ERR_NOT_IMPLEMENTED with a message naming the exact API. In this repo the live call sites include tls.createSecurePair, vm.measureMemory, v8.stopCoverage/takeCoverage, crypto.setEngine, crypto.secureHeapUsed, worker_threads getHeapSnapshot/parentPort.emit/removeAllListeners, fs.readlink with buffer encodings, ChildProcess.send with non-TCP handles, and cares setLocalAddress.","triggerScenarios":"Calling tls.createSecurePair() (legacy API, removed in Node 12 but still shimmed); vm.measureMemory(); v8.takeCoverage(); crypto.setEngine(...); parentPort.emit(...) in worker_threads; child.send(data, udpSocket) with a non-TCP handle; fs.readlink(path, { encoding: 'buffer' }).","commonSituations":"Running older libraries that predate modern TLS APIs (createSecurePair); coverage tooling that drives v8 coverage APIs; IPC code that ships sockets between processes; migration of Node tools to Deno hitting gaps in the compat layer.","solutions":["Replace the legacy call with the modern equivalent — tls.TLSSocket/tls.connect instead of createSecurePair; cluster/IPC alternatives instead of child.send with handles","Feature-detect and degrade gracefully: if (typeof fn === 'function') { try { fn(); } catch (e) { if (e.code === 'ERR_NOT_IMPLEMENTED') fallback(); } }","Run that code path under Node.js if the unimplemented API is essential to the library"],"exampleFix":"// before\nconst pair = tls.createSecurePair(credentials, false, false, false);\n\n// after\nconst socket = tls.connect({ socket: rawSocket, ...credentials, isServer: false });","handlingStrategy":"try-catch","validationCode":"const supported = (() => { try { tls.createSecurePair; return true; } catch { return false; } })();","typeGuard":null,"tryCatchPattern":"try { vm.measureMemory(); } catch (e) { if (e.code === 'ERR_NOT_IMPLEMENTED') { /* degrade: skip measurement */ } else throw e; }","preventionTips":["Prefer modern equivalents (TLSSocket, standard coverage tooling) over legacy Node APIs","Wrap optional Node-only APIs in a helper that catches ERR_NOT_IMPLEMENTED and no-ops"],"tags":["deno-compat","not-implemented","node-compat","polyfill"],"backgroundTag":null,"analyzedSha":"89f33cbef296a2b287f323d42de54c871fa69c77","analyzedAt":"2026-08-16T07:54:21.310Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}