{"record":{"id":"91ad038722e02d1d","repo":"coder/code-server","slug":"isenabledfileuploads-was-not-provided-to-the-brows","errorCode":null,"errorMessage":"isEnabledFileUploads was not provided to the browser","messagePattern":"isEnabledFileUploads was not provided to the browser","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"patches/external-file-actions.diff","lineNumber":81,"sourceCode":"+\n+\t/**\n \t * Gets whether a resolver extension is expected for the environment.\n \t */\n \treadonly expectsResolverExtension: boolean;\n@@ -111,6 +121,20 @@ export class BrowserWorkbenchEnvironment\n \t\treturn this.options.userDataPath;\n \t}\n \n+\tget isEnabledFileDownloads(): boolean {\n+\t\tif (typeof this.options.isEnabledFileDownloads === \"undefined\") {\n+\t\t\tthrow new Error('isEnabledFileDownloads was not provided to the browser');\n+\t\t}\n+\t\treturn this.options.isEnabledFileDownloads;\n+\t}\n+\n+\tget isEnabledFileUploads(): boolean {\n+\t\tif (typeof this.options.isEnabledFileUploads === \"undefined\") {\n+\t\t\tthrow new Error('isEnabledFileUploads was not provided to the browser');\n+\t\t}\n+\t\treturn this.options.isEnabledFileUploads;\n+\t}\n+\n \t@memoize\n \tget argvResource(): URI { return joinPath(this.userRoamingDataHome, 'argv.json'); }\n \nIndex: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts\n===================================================================\n--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts\n+++ code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts\n@@ -19,6 +19,8 @@ export const serverOptions: OptionDescri\n \t/* ----- code-server ----- */\n \t'disable-update-check': { type: 'boolean' },\n \t'auth': { type: 'string' },\n+\t'disable-file-downloads': { type: 'boolean' },\n+\t'disable-file-uploads': { type: 'boolean' },\n ","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/coder/code-server/blob/51f90a376b42e217b38937410fe2855e0c1db87e/patches/external-file-actions.diff#L63-L99","documentation":"Thrown by the isEnabledFileUploads getter added by the external-file-actions.diff patch to BrowserWorkbenchEnvironmentImpl when this.options.isEnabledFileUploads is undefined. It mirrors the downloads guard: any workbench code (e.g. the upload command) that reads the getter before the option is injected will throw.","triggerScenarios":"A workbench or extension code path evaluates environmentService.isEnabledFileUploads before code-server has supplied the option in the construction options; the patch added the getter but the matching server-side option wiring (serverEnvironmentService.ts hunk) was not applied.","commonSituations":"Partial patch application; version drift between the patch and the VS Code tree; a custom build that strips the upload option injection; an extension eagerly reading the flag at activation.","solutions":["Wire isEnabledFileUploads into the workbench construction options on the code-server side.","Apply the complete external-file-actions.diff (getter + serverEnvironmentService option registration).","Rebuild so the option is serialized into the browser config element.","Delay extension/workbench reads of the getter until after options are parsed."],"exampleFix":"// before\noptions.isEnabledFileDownloads = true\n// after\noptions.isEnabledFileDownloads = true\noptions.isEnabledFileUploads = true","handlingStrategy":"validation","validationCode":"options.isEnabledFileUploads = options.isEnabledFileUploads ?? true","typeGuard":"function optionsHasFileUploads(o: Record<string, unknown>): boolean {\n  return typeof o.isEnabledFileUploads === 'boolean'\n}","tryCatchPattern":"try {\n  return environmentService.isEnabledFileUploads\n} catch (e) {\n  if (/isEnabledFileUploads was not provided/.test(e.message)) return true\n}","preventionTips":["Inject isEnabledFileUploads alongside isEnabledFileDownloads.","Apply the full external-file-actions.diff.","Rebuild the workbench after patching.","Self-test option presence at workbench startup."],"tags":["workbench","patch","environment-service","file-actions","config"],"backgroundTag":null,"analyzedSha":"51f90a376b42e217b38937410fe2855e0c1db87e","analyzedAt":"2026-08-12T11:27:34.273Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}