{"record":{"id":"4cae2164bf887e25","repo":"transloadit/uppy","slug":"companion-hostname-is-required-please-consult-htt","errorCode":null,"errorMessage":"Companion hostname is required, please consult https://uppy.io/docs/companion","messagePattern":"Companion hostname is required, please consult https://uppy\\.io/docs/companion","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/@uppy/unsplash/src/Unsplash.tsx","lineNumber":73,"sourceCode":"    this.title = this.i18n('pluginNameUnsplash')\n\n    this.icon = () => (\n      <svg\n        className=\"uppy-DashboardTab-iconUnsplash\"\n        viewBox=\"0 0 32 32\"\n        height=\"32\"\n        width=\"32\"\n        aria-hidden=\"true\"\n      >\n        <g fill=\"currentcolor\">\n          <path d=\"M46.575 10.883v-9h12v9zm12 5h10v18h-32v-18h10v9h12z\" />\n          <path d=\"M13 12.5V8h6v4.5zm6 2.5h5v9H8v-9h5v4.5h6z\" />\n        </g>\n      </svg>\n    )\n\n    if (!this.opts.companionUrl) {\n      throw new Error(\n        'Companion hostname is required, please consult https://uppy.io/docs/companion',\n      )\n    }\n\n    this.hostname = this.opts.companionUrl\n\n    this.opts.companionAllowedHosts = getAllowedHosts(\n      this.opts.companionAllowedHosts,\n      this.opts.companionUrl,\n    )\n    this.provider = new SearchProvider(uppy, {\n      companionUrl: this.opts.companionUrl,\n      companionHeaders: this.opts.companionHeaders,\n      companionCookiesRule: this.opts.companionCookiesRule,\n      provider: 'unsplash',\n      pluginId: this.id,\n    })\n  }","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/transloadit/uppy/blob/5d4dedd02a1ac0ae022c75c54aca76558f88e256/packages/@uppy/unsplash/src/Unsplash.tsx#L55-L91","documentation":"The Unsplash provider plugin requires a Companion server URL because all Unsplash API traffic is proxied through Companion. The constructor throws immediately if opts.companionUrl is falsy, pointing at the Companion docs.","triggerScenarios":"new Unsplash(uppy, {}) or with companionUrl: '' / undefined. Any instantiation without a configured Companion endpoint.","commonSituations":"Copy-pasting example code that omits companionUrl, forgetting that provider plugins need a server, setting the option under a wrong key (e.g. companion instead of companionUrl), or env-variable-driven config that's empty in some environment.","solutions":["Pass a valid companionUrl: new Unsplash(uppy, { companionUrl: 'https://your-companion.example.com' })","If self-hosting, deploy Companion and use its URL; if using Transloadit, use the Transloadit Companion URL","Verify the env var feeding companionUrl is actually set in the failing environment"],"exampleFix":"// before\nuppy.use(Unsplash, {})\n\n// after\nuppy.use(Unsplash, { companionUrl: 'https://companion.myapp.com' })","handlingStrategy":"validation","validationCode":"const companionUrl = process.env.COMPANION_URL\nif (companionUrl) uppy.use(Unsplash, { companionUrl })","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0","tryCatchPattern":"try { uppy.use(Unsplash, { companionUrl }) } catch (e) { if (e.message.includes('Companion hostname')) console.warn('Unsplash disabled: no Companion') }","preventionTips":["Centralize companionUrl in one config module and assert it at startup","Fail fast in CI when required env vars are missing","Remember all remote-provider plugins require Companion"],"tags":["companion","configuration","unsplash","required-option"],"backgroundTag":"missing-required-config","analyzedSha":"5d4dedd02a1ac0ae022c75c54aca76558f88e256","analyzedAt":"2026-08-28T12:18:41.267Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}