{"record":{"id":"0ff0263f77fec7c7","repo":"discordjs/discord.js","slug":"node-type-type-does-not-exist","errorCode":null,"errorMessage":"Node type '${type}' does not exist!","messagePattern":"Node type '(.+?)' does not exist!","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/voice/src/audio/TransformerGraph.ts","lineNumber":113,"sourceCode":"\t *\n\t * @param edge - The edge to create\n\t */\n\tpublic addEdge(edge: Omit<Edge, 'from'>) {\n\t\tthis.edges.push({ ...edge, from: this });\n\t}\n}\n\n// Create a node for each stream type\nlet NODES: Map<StreamType, Node> | null = null;\n\n/**\n * Gets a node from its stream type.\n *\n * @param type - The stream type of the target node\n */\nexport function getNode(type: StreamType) {\n\tconst node = (NODES ??= initializeNodes()).get(type);\n\tif (!node) throw new Error(`Node type '${type}' does not exist!`);\n\treturn node;\n}\n\n// Try to enable FFmpeg Ogg optimizations\nfunction canEnableFFmpegOptimizations(): boolean {\n\ttry {\n\t\treturn prism.FFmpeg.getInfo().output.includes('--enable-libopus');\n\t} catch {}\n\n\treturn false;\n}\n\nfunction initializeNodes(): Map<StreamType, Node> {\n\tconst nodes = new Map<StreamType, Node>();\n\tfor (const streamType of Object.values(StreamType)) {\n\t\tnodes.set(streamType, new Node(streamType));\n\t}\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/discordjs/discord.js/blob/a81ed8a306d37fdc746e26a634b6a42164ba2c8c/packages/voice/src/audio/TransformerGraph.ts#L95-L131","documentation":"getNode() looks up a node in the transformer graph by StreamType; throwing when the key is absent. This is an internal invariant guard used by findPath/findPipeline, surfacing when an unknown stream type string is supplied.","triggerScenarios":"Passing an invalid/unknown StreamType value (typo, wrong string) to createAudioResource via options.inputType, or programmatically calling getNode with a non-existent StreamType enum member.","commonSituations":"Typo in inputType string like 'ogg/opus' vs 'ogg/opus' variants; upgrading @discordjs/voice where StreamType members changed; hand-rolling a custom pipeline against getNode.","solutions":["Use the exported StreamType enum instead of raw strings","Check the StreamType enum in your installed @discordjs/voice version for the exact key","Update @discordjs/voice to the latest version","Only call getNode/findPipeline with enum members"],"exampleFix":"// before\ncreateAudioResource(file, { inputType: 'webm/opus' as any });\n// after\nimport { StreamType } from '@discordjs/voice';\ncreateAudioResource(file, { inputType: StreamType.WebmOpus });","handlingStrategy":"validation","validationCode":"import { StreamType } from '@discordjs/voice';\nfunction isValidStreamType(t) { return Object.values(StreamType).includes(t); }\nif (!isValidStreamType(opts.inputType)) throw new TypeError('unknown inputType');","typeGuard":"function isStreamType(v: string): v is StreamType { return Object.values(StreamType).includes(v as StreamType); }","tryCatchPattern":"try { res = createAudioResource(input, { inputType }); } catch (e) { if (e.message.includes('does not exist')) res = createAudioResource(input); else throw e; }","preventionTips":["Always use the StreamType enum, never raw strings","Check enum members against your installed @discordjs/voice version","Avoid calling internal getNode/findPipeline directly","Pin and update the library version consistently"],"tags":["audio","stream-type","invalid-argument"],"backgroundTag":"unknown-stream-type","analyzedSha":"a81ed8a306d37fdc746e26a634b6a42164ba2c8c","analyzedAt":"2026-08-30T04:07:22.193Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}