{"record":{"id":"679ed01defe6b56c","repo":"remotion-dev/remotion","slug":"no-src-provided","errorCode":null,"errorMessage":"No \"src\" provided","messagePattern":"No \"src\" provided","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/media-parser/src/internal-parse-media.ts","lineNumber":48,"sourceCode":"\tonVideoTrack,\n\tcontroller = mediaParserController(),\n\tlogLevel,\n\tonParseProgress: onParseProgressDoNotCallDirectly,\n\tprogressIntervalInMs,\n\tmode,\n\tonDiscardedData,\n\tonError,\n\tacknowledgeRemotionLicense,\n\tapiName,\n\tselectM3uStream: selectM3uStreamFn,\n\tselectM3uAssociatedPlaylists: selectM3uAssociatedPlaylistsFn,\n\tm3uPlaylistContext,\n\tmakeSamplesStartAtZero,\n\tseekingHints,\n\t...more\n}: InternalParseMediaOptions<F>) {\n\tif (!src) {\n\t\tthrow new Error('No \"src\" provided');\n\t}\n\n\tcontroller._internals.markAsReadyToEmitEvents();\n\twarnIfRemotionLicenseNotAcknowledged({\n\t\tacknowledgeRemotionLicense,\n\t\tlogLevel,\n\t\tapiName,\n\t});\n\n\tLog.verbose(\n\t\tlogLevel,\n\t\t`Reading ${typeof src === 'string' ? src : src instanceof URL ? src.toString() : src instanceof File ? src.name : src.toString()}`,\n\t);\n\n\tconst prefetchCache = new Map<string, ReturnType<typeof makeFetchRequest>>();\n\n\tconst {\n\t\treader: readerInstance,","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/media-parser/src/internal-parse-media.ts#L30-L66","documentation":"internalParseMedia destructures src from its options and immediately throws if it is falsy. This is the earliest guard before any reader is constructed: the library cannot fetch, open, or stream anything without a source. src may be a string URL, a URL object, or a File.","triggerScenarios":"Calling parseMedia (or parseMediaOnWorker) with src omitted, set to undefined/null, an empty string '', or 0. Common when src is computed from a variable that was never assigned.","commonSituations":"Form/upload flows where the file URL is empty until upload finishes, env-driven configs where the URL var is missing in one environment, or refactors that rename the field but leave callers passing the old name.","solutions":["Ensure src is a non-empty string | URL | File before calling parseMedia.","Guard at the call site: `if (!src) throw new Error('src required')` with a clearer domain message.","Log the src value just before the call when debugging integration code.","Add a TypeScript satisfies on the options object so a missing src is caught at compile time."],"exampleFix":"// before\nawait parseMedia({fields: {durationInSeconds: true}}); // src forgotten\n\n// after\nif (!url) throw new Error('Cannot parse: no media URL provided by uploader');\nawait parseMedia({src: url, fields: {durationInSeconds: true}});","handlingStrategy":"validation","validationCode":"function assertSrc(src: unknown): asserts src is string | URL | File {\n  if (!src || (typeof src !== 'string' && !(src instanceof URL) && !(src instanceof File))) {\n    throw new Error('parseMedia requires a non-empty src (string | URL | File)');\n  }\n}\nassertSrc(url);\nawait parseMedia({src: url, fields: {}});","typeGuard":"const isValidSrc = (src: unknown): src is string | URL | File =>\n  typeof src === 'string' ? src.length > 0 : src instanceof URL || src instanceof File;","tryCatchPattern":"if (!url) throw new Error('Cannot start parse: uploader returned no URL');\ntry {\n  await parseMedia({src: url, fields: {durationInSeconds: true}});\n} catch (e) {\n  if (e instanceof Error && e.message === 'No \"src\" provided') {\n    throw new Error('Internal: src became falsy before parse');\n  }\n  throw e;\n}","preventionTips":["Always validate src is non-empty at the call site with a domain-specific error.","Make src a required function parameter (not optional) in your wrapper.","Use TypeScript satisfies/strict types so missing src is a compile error.","Log src provenance (uploader, env, config) to debug emptiness quickly."],"tags":["validation","api-misuse","typescript","media-parser"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}