alyssaxuu/screenity · critical · Error
No valid media uploaded - both screen and camera mediaId are
Error message
No valid media uploaded - both screen and camera mediaId are missing
What it means
After upload completes, CloudRecorder verifies that at least one media track actually uploaded successfully. If neither uploadMeta.screen.mediaId nor uploadMeta.camera.mediaId is set, no usable media exists on the server, so scene creation cannot continue and this error is thrown.
Source
Thrown at src/pages/CloudRecorder/CloudRecorder.jsx:6083
"recordedTabDomain",
"recordingType",
]);
const { cameraFlipped } = await chrome.storage.local.get(["cameraFlipped"]);
let insertAfterSceneId = null;
if (multiMode) {
insertAfterSceneId = multiLastSceneId || activeSceneId;
} else {
insertAfterSceneId = activeSceneId;
}
if (!uploadMeta.sceneId) {
throw new Error("Missing sceneId in uploadMeta");
}
if (!uploadMeta.screen?.mediaId && !uploadMeta.camera?.mediaId) {
throw new Error(
"No valid media uploaded - both screen and camera mediaId are missing",
);
}
const sceneId = uploadMeta.sceneId;
const existingStatus = await getSceneCreateStatus(sceneId);
let sceneOutcome = null;
let shouldIncrementMultiSceneCount = false;
if (existingStatus?.status === "created") {
logDebugEvent("scene-create-skip", {
projectId,
sceneId,
});
// No ensureMediaLinked call here: /api/bunny/videos already
// stamped each media's `usedIn` at TUS init time, and the prior
// /scenes/ POST already cleared `recoveryState`. PATCH was a
// no-op + a post-stop hang risk in the dying cloudrecorder tab.View on GitHub (pinned to 512606387b)
Solutions
- Inspect uploader telemetry/errors (onUploaderTelemetry/onStateChange) to find why both uploads failed, and retry the failed upload with backoff before giving up.
- Verify auth: refresh tokens before upload start and handle 401/403 by re-authenticating and resuming uploads.
- Check that onStop actually flushes/closes encoders so pending frames are uploaded when the recording is very short.
- Add offline detection (navigator.onLine / connectivity change) to pause and resume uploads instead of failing silently.
- If retry is impossible, show the user a clear 'recording could not be saved' error and offer to re-record rather than proceeding with no media.
Example fix
// before
if (!uploadMeta.screen?.mediaId && !uploadMeta.camera?.mediaId) {
throw new Error("No valid media uploaded - both screen and camera mediaId are missing");
}
// after
if (!uploadMeta.screen?.mediaId && !uploadMeta.camera?.mediaId) {
const retried = await retryFailedUploads(uploadMeta, { attempts: 2 });
if (!retried.screen?.mediaId && !retried.camera?.mediaId) {
throw new Error("No valid media uploaded - both screen and camera mediaId are missing");
}
uploadMeta = retried;
} Defensive patterns
Strategy: retry
Validate before calling
const hasMedia = Boolean(uploadMeta?.screen?.mediaId || uploadMeta?.camera?.mediaId);
if (!hasMedia) {
console.error("No uploaded media present; check uploader telemetry for failures");
} Type guard
function hasUploadedMedia(meta) {
return Boolean(meta?.screen?.mediaId || meta?.camera?.mediaId);
} Try / catch
try {
await finalizeUpload(uploadMeta);
} catch (err) {
if (err.message.startsWith("No valid media uploaded")) {
showRecordingLostDialog({ canRetry: navigator.onLine });
} else {
throw err;
}
} Prevention
- Implement upload retry with exponential backoff inside the uploader
- Refresh auth tokens before and during long recordings
- Verify encoders flush remaining frames on stop for very short recordings
- Monitor onUploaderStateChange and abort early with a clear message when uploads first fail
- Check navigator.onLine and queue/resume uploads across connectivity loss
When it happens
Trigger: Both the screen and camera uploaders failed or returned no mediaId — e.g. all network uploads errored, upload credentials were rejected (401/403), recorder stopped before any data was captured, or onUploadFinished was called without a successful upload response.
Common situations: Recording on an unstable/offline network so chunks never finish uploading; expired auth token mid-upload; screen capture produced zero frames (protected content, no tab share chosen); very short recording stopped before the uploader flushed data.
Related errors
- Failed to initialize uploaders
- Failed to start TUS upload session
- Missing projectId
- Camera track has ended
- Missing sceneId in uploadMeta
AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02).
Data as JSON: /api/errors/9555c6879101fed7.
Report an issue: GitHub.