{"record":{"id":"19b3975e5d3807bd","repo":"transloadit/uppy","slug":"if-you-want-to-use-as-server-path-leave-the","errorCode":null,"errorMessage":"If you want to use '/' as server.path, leave the 'path' variable unset","messagePattern":"If you want to use '/' as server\\.path, leave the 'path' variable unset","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@uppy/companion/src/config/companion.ts","lineNumber":110,"sourceCode":"export function validateConfig(companionOptions: CompanionInitOptions): void {\n  const parsedConfig = validateConfigSchema.parse(companionOptions)\n  const { filePath } = parsedConfig\n\n  // validate that specified filePath is writeable/readable.\n  try {\n    fs.accessSync(filePath, fs.constants.R_OK | fs.constants.W_OK)\n  } catch {\n    throw new Error(\n      `No access to \"${filePath}\". Please ensure the directory exists and with read/write permissions.`,\n    )\n  }\n\n  const { providerOptions, server, uploadUrls } = companionOptions\n\n  // see https://github.com/transloadit/uppy/issues/4271\n  // todo fix the code so we can allow `/`\n  if (server.path === '/') {\n    throw new Error(\n      \"If you want to use '/' as server.path, leave the 'path' variable unset\",\n    )\n  }\n\n  if (providerOptions) {\n    const deprecatedOptions: Record<string, string> = {\n      microsoft: 'providerOptions.onedrive',\n      google: 'providerOptions.drive',\n      s3: 's3',\n    }\n    Object.keys(deprecatedOptions).forEach((deprecated) => {\n      if (Object.hasOwn(providerOptions, deprecated)) {\n        throw new Error(\n          `The Provider option \"providerOptions.${deprecated}\" is no longer supported. Please use the option \"${deprecatedOptions[deprecated]}\" instead.`,\n        )\n      }\n    })\n  }","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/companion/src/config/companion.ts#L92-L128","documentation":"Companion historically cannot serve correctly when server.path is '/', so validateConfig rejects it and asks you to leave path unset (which already defaults to root mounting). See uppy issue #4271.","triggerScenarios":"Setting { server: { path: '/' } } in the Companion options/config file.","commonSituations":"Trying to explicitly mount Companion at the root path when reverse-proxying; copying configs from tutorials that set path: '/'.","solutions":["Remove the path option entirely (root is the default)","If you need a prefix, use a non-root path like '/companion'"],"exampleFix":"// before\nserver: { path: '/' }\n\n// after\nserver: {}","handlingStrategy":"validation","validationCode":"if (server.path === '/') delete server.path","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Leave path unset for root mounting","Use a non-root prefix like /companion when a prefix is needed","Add config linting before startup"],"tags":["companion","configuration","startup"],"backgroundTag":"invalid-configuration-value","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}