Browse Source

Merge pull request #1459 from transloadit/chore/warning-companionUrl

Issue a warning if an outdated `serverUrl` or `serverPattern` option is used
Artur Paikin 6 years ago
parent
commit
09dff564a3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      packages/@uppy/companion-client/src/Provider.js

+ 4 - 0
packages/@uppy/companion-client/src/Provider.js

@@ -74,6 +74,10 @@ module.exports = class Provider extends RequestClient {
       plugin.opts = Object.assign({}, defaultOpts, opts)
     }
 
+    if (opts.serverUrl || opts.serverPattern) {
+      throw new Error('`serverUrl` and `serverPattern` have been renamed to `companionUrl` and `companionAllowedHosts` respectively in 0.30.5 release. Please consult the docs (for example, https://uppy.io/docs/instagram/ for Instagram plugin) and use the updated options.`')
+    }
+
     if (opts.companionAllowedHosts) {
       const pattern = opts.companionAllowedHosts
       // validate companionAllowedHosts param