alyssaxuu/screenity · error · Error
Failed to create video project
Error message
Failed to create video project
What it means
Thrown when neither storage (projectId/multiProjectId), the project prefetch, nor a fresh createVideoProject() call yields a video ID. It guards against continuing the recording pipeline without a backend project to attach scenes/media to.
Source
Thrown at src/pages/CloudRecorder/CloudRecorder.jsx:7892
multiSceneCount: multiSceneCount || 0,
});
}
} else {
// Usually already resolved by the prefetch kicked off before mic
// acquisition; falls back to a fresh create if the prefetch saw a
// project in storage that has since been cleared.
videoId = await projectPrefetch;
if (!videoId) {
const now = new Date();
const options = { day: "2-digit", month: "short", year: "numeric" };
const startedAt = Date.now();
videoId = await createVideoProject({
title: `Untitled video - ${now.toLocaleString("en-GB", options)}`,
instantMode: instantMode.current,
});
projectCreateMs = Date.now() - startedAt;
}
if (!videoId) throw new Error("Failed to create video project");
if (multiMode) {
await chrome.storage.local.set({
multiProjectId: videoId,
multiSceneCount: 0,
});
}
}
await chrome.storage.local.set({ projectId: videoId });
// Fresh projects already carry hasRecordingSession, so only
// reused ones need the hint.
if (reusedProject) notifyRecordingStarted(videoId);
traceStep("apiProjectCreated", {
projectCreateMs,
projectReused: reusedProject,
});
void emitUploadTelemetry("project_state_change", {View on GitHub (pinned to 512606387b)
Solutions
- Log the response inside createVideoProject to see why it returns falsy (network error, non-2xx, missing id in body)
- Check auth/session validity before starting recording; expired tokens commonly make the create call fail silently
- Confirm the prefetch promise is not being .catch()'d to null elsewhere and hiding a real error
- Retry the recording start; transient network failures to the project-create endpoint are the usual cause
Example fix
// before
videoId = await createVideoProject({ title, instantMode: instantMode.current });
if (!videoId) throw new Error("Failed to create video project");
// after
videoId = await createVideoProject({ title, instantMode: instantMode.current });
if (!videoId) {
const created = await createVideoProject({ title, instantMode: instantMode.current });
videoId = created?.id ?? created;
}
if (!videoId) throw new Error("Failed to create video project"); Defensive patterns
Strategy: validation
Validate before calling
const { projectId, multiProjectId } = await chrome.storage.local.get(["projectId", "multiProjectId"]);
const prefetchId = await projectPrefetch.catch(() => null);
if (!projectId && !multiProjectId && !prefetchId && !(await isBackendReachable())) {
throw new Error("Cannot start: no project and backend unreachable");
} Type guard
function hasVideoId(v) {
return typeof v === "string" && v.length > 0 || typeof v === "number" && Number.isFinite(v);
} Try / catch
try {
videoId = await createVideoProject({ title, instantMode });
} catch (err) {
sendRecordingError("Project create failed: " + err.message);
}
if (!hasVideoId(videoId)) {
videoId = await createVideoProject({ title, instantMode }); // one retry
}
if (!hasVideoId(videoId)) throw new Error("Failed to create video project"); Prevention
- Make createVideoProject throw on API errors instead of silently returning null
- Check auth validity and network reachability before recording start
- Log the create response body so a falsy return is always diagnosable
- Treat projectPrefetch rejections as errors, not silently swallowed nulls
When it happens
Trigger: chrome.storage.local has no projectId and no multiProjectId, projectPrefetch resolves to a falsy value, and the fallback createVideoProject({title, instantMode}) returns null/undefined instead of an ID.
Common situations: createVideoProject silently swallowing an API error (auth expired, network down, backend 5xx) and returning null instead of throwing; prefetch raced with a storage clear and lost; user's account hit a project-creation limit.
Related errors
AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02).
Data as JSON: /api/errors/f3ed9076add6ecc4.
Report an issue: GitHub.