{"record":{"id":"5fbe69ca5133b8a3","repo":"discordjs/discord.js","slug":"invalid-pipeline-constructed-for-string-resource","errorCode":null,"errorMessage":"Invalid pipeline constructed for string resource '${input}'","messagePattern":"Invalid pipeline constructed for string resource '(.+?)'","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/voice/src/audio/AudioResource.ts","lineNumber":277,"sourceCode":"\tinput: Readable | string,\n\toptions: CreateAudioResourceOptions<Metadata> = {},\n): AudioResource<Metadata> {\n\tlet inputType = options.inputType;\n\tlet needsInlineVolume = Boolean(options.inlineVolume);\n\n\t// string inputs can only be used with FFmpeg\n\tif (typeof input === 'string') {\n\t\tinputType = StreamType.Arbitrary;\n\t} else if (inputType === undefined) {\n\t\tconst analysis = inferStreamType(input);\n\t\tinputType = analysis.streamType;\n\t\tneedsInlineVolume = needsInlineVolume && !analysis.hasVolume;\n\t}\n\n\tconst transformerPipeline = findPipeline(inputType, needsInlineVolume ? VOLUME_CONSTRAINT : NO_CONSTRAINT);\n\n\tif (transformerPipeline.length === 0) {\n\t\tif (typeof input === 'string') throw new Error(`Invalid pipeline constructed for string resource '${input}'`);\n\t\t// No adjustments required\n\t\treturn new AudioResource<Metadata>(\n\t\t\t[],\n\t\t\t[input],\n\t\t\t(options.metadata ?? null) as Metadata,\n\t\t\toptions.silencePaddingFrames ?? 5,\n\t\t);\n\t}\n\n\tconst streams = transformerPipeline.map((edge) => edge.transformer(input));\n\tif (typeof input !== 'string') streams.unshift(input);\n\n\treturn new AudioResource<Metadata>(\n\t\ttransformerPipeline,\n\t\tstreams,\n\t\t(options.metadata ?? null) as Metadata,\n\t\toptions.silencePaddingFrames ?? 5,\n\t);","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/discordjs/discord.js/blob/a81ed8a306d37fdc746e26a634b6a42164ba2c8c/packages/voice/src/audio/AudioResource.ts#L259-L295","documentation":"createAudioResource() builds a transformer pipeline from the input stream type; if findPipeline returns an empty pipeline while inline volume was requested (no volume transform available), a string input cannot be used and the library throws. It signals that no valid transformer path exists for the given input type/volume constraint combination.","triggerScenarios":"Calling createAudioResource(path, { inlineVolume: true }) (or default when ffmpeg-volume analysis says no stream volume) where the transformer graph yields zero transformers for the input type — typically an unrecognized/unsupported input string or missing ffmpeg causing a fallback type with no volume node.","commonSituations":"Passing a URL or path with an unsupported extension/protocol; missing or broken FFmpeg install so stream analysis picks a type without a volume transformer; forcing an input type via options.inputType that lacks volume support while inlineVolume is requested.","solutions":["Verify FFmpeg is installed and on PATH (ffmpeg -version)","Pass options.inputType explicitly (e.g. StreamType.Arbitrary) so a valid pipeline is found","Set inlineVolume: false if you don't need volume adjustment","Ensure the string points to a real, supported media file/URL"],"exampleFix":"// before\nconst res = createAudioResource(url, { inlineVolume: true });\n// after\nconst res = createAudioResource(url, { inputType: StreamType.Arbitrary, inlineVolume: false });","handlingStrategy":"validation","validationCode":"import { execFileSync } from 'child_process';\nconst ffmpegOk = (() => { try { execFileSync('ffmpeg', ['-version'], { stdio: 'ignore' }); return true; } catch { return false; } })();\nif (!ffmpegOk) throw new Error('FFmpeg required for this resource');\nconst res = createAudioResource(input, { inputType: StreamType.Arbitrary, inlineVolume: false });","typeGuard":null,"tryCatchPattern":"try { res = createAudioResource(input, { inlineVolume: true }); } catch (e) { if (e.message.startsWith('Invalid pipeline')) res = createAudioResource(input, { inlineVolume: false }); else throw e; }","preventionTips":["Install FFmpeg and keep it on PATH","Set options.inputType explicitly for non-file inputs","Disable inlineVolume when volume control isn't needed","Validate URLs/paths are supported media before creating resources"],"tags":["audio","ffmpeg","configuration"],"backgroundTag":"invalid-audio-pipeline","analyzedSha":"a81ed8a306d37fdc746e26a634b6a42164ba2c8c","analyzedAt":"2026-08-30T04:07:22.193Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}