alyssaxuu/screenity · error · Error

Missing projectId

Error message

Missing projectId

What it means

The CloudRecorder requires a projectId to initialize its uploaders and associate uploaded media with a project. It throws this error as a fail-fast guard right after logging uploaders-init-start when the resolved projectId is falsy (undefined, null, or empty string).

Source

Thrown at src/pages/CloudRecorder/CloudRecorder.jsx:3967

      let constrainedScreenDims = null;
      const { projectId } = await chrome.storage.local.get(["projectId"]);
      const sessionId = ensureRecordingSessionId();

      const sceneId = await getOrCreateSceneId({
        forceNew: forceNewSceneId,
      });
      await chrome.storage.local.set({
        sceneId,
        sceneIdStatus: "recording",
      });
      await setPipelineState("uploaders-initializing", {
        projectId,
        sceneId,
      });
      logDebugEvent("uploaders-init-start", { projectId, sceneId });

      if (!projectId) {
        throw new Error("Missing projectId");
      }

      const onUploaderTelemetry =
        (trackType) => (eventName, payload = {}) => {
          void emitUploadTelemetry(eventName, {
            projectId,
            sceneId,
            trackType,
            ...payload,
          });
        };

      const onUploaderStateChange = (trackType) => (state = {}) => {
        patchTrackState(trackType, {
          lastUploadOffset: state?.offset || 0,
          uploaderUpdatedAt: Date.now(),
        });
        persistSessionState();

View on GitHub (pinned to 512606387b)

Solutions

  1. Guard the caller: read projectId from the URL/route and redirect to project selection or show a 'missing project' error page before mounting CloudRecorder.
  2. Ensure the data fetch that resolves projectId completes before rendering (await the query / only render with data).
  3. Check how projectId is parsed from the URL — verify the query key name matches what is generated on link creation.
  4. If projectId comes from an async lookup, validate the response and surface an explicit error instead of passing undefined through.
  5. Add a client-side validation on link generation so share URLs are never produced without projectId.

Example fix

// before
const { projectId } = params; // may be undefined
<CloudRecorder projectId={projectId} sceneId={sceneId} />
// after
if (!params.projectId) {
  return <MissingProjectRedirect />;
}
<CloudRecorder projectId={params.projectId} sceneId={sceneId} />
Defensive patterns

Strategy: validation

Validate before calling

const projectId = new URLSearchParams(window.location.search).get("projectId");
if (!projectId) {
  throw new Error("Cannot open CloudRecorder: projectId is missing from the URL");
}

Type guard

function hasProjectId(args) {
  return typeof args?.projectId === "string" && args.projectId.length > 0;
}

Try / catch

try {
  renderCloudRecorder({ projectId, sceneId });
} catch (err) {
  if (err.message === "Missing projectId") {
    redirectToProjectPicker();
  } else {
    throw err;
  }
}

Prevention

When it happens

Trigger: Opening/recording in CloudRecorder with a URL or props missing the projectId query param, a stale share link that omitted it, or a code path constructing CloudRecorder state before the project record loaded so projectId resolves to undefined.

Common situations: Users bookmarking or sharing a recording URL without ?projectId=; API response returning null project on first load; navigation race where the component mounts before project data is fetched; renamed query parameters after a routing refactor.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02). Data as JSON: /api/errors/3088f32a130cffb8. Report an issue: GitHub.