{"record":{"id":"b06cb3bcc14b3f77","repo":"remotion-dev/remotion","slug":"opfs-is-not-available-in-this-browser","errorCode":null,"errorMessage":"OPFS is not available in this browser","messagePattern":"OPFS is not available in this browser","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/browser-studio/src/opfs-public-files.ts","lineNumber":54,"sourceCode":"\tconst browserStudioDirectory = await root.getDirectoryHandle(\n\t\tbrowserStudioDirectoryName,\n\t\t{create},\n\t);\n\treturn browserStudioDirectory.getDirectoryHandle(projectsDirectoryName, {\n\t\tcreate,\n\t});\n};\n\nconst getProjectDirectory = async ({\n\tcreate,\n\tstorage,\n}: {\n\tcreate: boolean;\n\tstorage: BrowserStudioProjectStorage;\n}) => {\n\tconst projectsDirectory = await getProjectsDirectory({create});\n\tif (projectsDirectory === null) {\n\t\tthrow new Error('OPFS is not available in this browser');\n\t}\n\n\treturn projectsDirectory.getDirectoryHandle(storage.directoryName, {create});\n};\n\nconst releaseBrowserStudioProjectStorageLease = async (\n\tstorage: BrowserStudioProjectStorage,\n) => {\n\tconst lease = projectStorageLeases.get(storage.directoryName);\n\tif (!lease) {\n\t\treturn;\n\t}\n\n\tprojectStorageLeases.delete(storage.directoryName);\n\tlease.release();\n\tawait lease.finished;\n};\n","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/remotion-dev/remotion/blob/10db9de07356446fb0edb3c3ae211369b693d18b/packages/browser-studio/src/opfs-public-files.ts#L36-L72","documentation":"Browser Studio stores project public files in the Origin Private File System (OPFS). getProjectDirectory() calls getProjectsDirectory(), which returns null when navigator.storage.getDirectory is absent, and translates that null into this error. OPFS requires a modern browser (Chromium 102+, Safari 15.2+, Firefox 111+) and a secure context (HTTPS or localhost); note createBrowserStudioProjectStorage() itself returns null instead of throwing, so this error means a code path reached OPFS without that pre-check.","triggerScenarios":"Running a code path that calls getProjectDirectory (via createBrowserStudioProjectStorage, collectBrowserStudioProjectStorageGarbage, or writeBrowserStudioStoredPublicFile) in a browser where navigator.storage.getDirectory is undefined - old browsers, non-secure contexts (plain http on a LAN IP), or restricted embedded WebViews.","commonSituations":"Opening Browser Studio in an outdated browser or WebView; serving the page over plain HTTP on a non-localhost host (secure context lost); enterprise browsers with storage APIs disabled.","solutions":["Use a browser with OPFS support: Chrome/Edge 102+, Safari 15.2+, Firefox 111+","Serve the page over HTTPS or localhost - OPFS requires a secure context","Update the embedded WebView/browser engine if Browser Studio runs inside one"],"exampleFix":"// before: calling OPFS-dependent APIs blindly\nconst storage = await createBrowserStudioProjectStorage(); // returns null when unsupported\n// later: getProjectDirectory() throws 'OPFS is not available in this browser'\n\n// after: feature-detect first and fail with guidance\nif (typeof navigator?.storage?.getDirectory !== 'function') {\n  throw new Error('Browser Studio requires OPFS - use Chrome 102+, Safari 15.2+, or Firefox 111+ over HTTPS');\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const isOpfsAvailable = (): boolean =>\n  typeof navigator !== 'undefined' &&\n  typeof (navigator.storage as {getDirectory?: unknown} | undefined)?.getDirectory === 'function';","tryCatchPattern":"try {\n  await writeBrowserStudioStoredPublicFile({contents, storage});\n} catch (e) {\n  if (/OPFS is not available/.test(String((e as Error).message))) {\n    // fall back to in-memory public files or instruct the user to switch to an OPFS-capable browser\n  } else throw e;\n}","preventionTips":["Feature-detect navigator.storage.getDirectory before enabling OPFS-dependent features","Serve Browser Studio over HTTPS or localhost - OPFS requires a secure context","Advertise the minimum browsers (Chrome/Edge 102+, Safari 15.2+, Firefox 111+) to users"],"tags":["browser-studio","opfs","storage","browser-support","secure-context"],"backgroundTag":"browser-api-unsupported","analyzedSha":"10db9de07356446fb0edb3c3ae211369b693d18b","analyzedAt":"2026-08-22T21:45:17.748Z","contentChangedAt":"2026-08-22T21:45:17.748Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}