{"record":{"id":"3088f32a130cffb8","repo":"alyssaxuu/screenity","slug":"missing-projectid","errorCode":null,"errorMessage":"Missing projectId","messagePattern":"Missing projectId","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/pages/CloudRecorder/CloudRecorder.jsx","lineNumber":3967,"sourceCode":"      let constrainedScreenDims = null;\n      const { projectId } = await chrome.storage.local.get([\"projectId\"]);\n      const sessionId = ensureRecordingSessionId();\n\n      const sceneId = await getOrCreateSceneId({\n        forceNew: forceNewSceneId,\n      });\n      await chrome.storage.local.set({\n        sceneId,\n        sceneIdStatus: \"recording\",\n      });\n      await setPipelineState(\"uploaders-initializing\", {\n        projectId,\n        sceneId,\n      });\n      logDebugEvent(\"uploaders-init-start\", { projectId, sceneId });\n\n      if (!projectId) {\n        throw new Error(\"Missing projectId\");\n      }\n\n      const onUploaderTelemetry =\n        (trackType) => (eventName, payload = {}) => {\n          void emitUploadTelemetry(eventName, {\n            projectId,\n            sceneId,\n            trackType,\n            ...payload,\n          });\n        };\n\n      const onUploaderStateChange = (trackType) => (state = {}) => {\n        patchTrackState(trackType, {\n          lastUploadOffset: state?.offset || 0,\n          uploaderUpdatedAt: Date.now(),\n        });\n        persistSessionState();","sourceCodeStart":3949,"sourceCodeEnd":3985,"githubUrl":"https://github.com/alyssaxuu/screenity/blob/512606387b8d07dda5e63bb428bd063f0a2a3ed0/src/pages/CloudRecorder/CloudRecorder.jsx#L3949-L3985","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Guard the caller: read projectId from the URL/route and redirect to project selection or show a 'missing project' error page before mounting CloudRecorder.","Ensure the data fetch that resolves projectId completes before rendering (await the query / only render with data).","Check how projectId is parsed from the URL — verify the query key name matches what is generated on link creation.","If projectId comes from an async lookup, validate the response and surface an explicit error instead of passing undefined through.","Add a client-side validation on link generation so share URLs are never produced without projectId."],"exampleFix":"// before\nconst { projectId } = params; // may be undefined\n<CloudRecorder projectId={projectId} sceneId={sceneId} />\n// after\nif (!params.projectId) {\n  return <MissingProjectRedirect />;\n}\n<CloudRecorder projectId={params.projectId} sceneId={sceneId} />","handlingStrategy":"validation","validationCode":"const projectId = new URLSearchParams(window.location.search).get(\"projectId\");\nif (!projectId) {\n  throw new Error(\"Cannot open CloudRecorder: projectId is missing from the URL\");\n}","typeGuard":"function hasProjectId(args) {\n  return typeof args?.projectId === \"string\" && args.projectId.length > 0;\n}","tryCatchPattern":"try {\n  renderCloudRecorder({ projectId, sceneId });\n} catch (err) {\n  if (err.message === \"Missing projectId\") {\n    redirectToProjectPicker();\n  } else {\n    throw err;\n  }\n}","preventionTips":["Validate URL params at the route level before mounting the component","Never generate share/record links without projectId","Await project data fetch before rendering CloudRecorder","Surface explicit UI errors for missing query params instead of passing undefined"],"tags":["validation","missing-parameter","cloud-recorder","config"],"backgroundTag":"missing-required-argument","analyzedSha":"512606387b8d07dda5e63bb428bd063f0a2a3ed0","analyzedAt":"2026-09-02T20:59:09.419Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}