Uppy: How to remove a plugin ?

Created on 31 Aug 2020  Â·  1Comment  Â·  Source: transloadit/uppy

I want to update the endpoint of the XHRUpload plugin without reloading the uppy instance (and loose the selected files if any). My strategy is to remove the plugin and re-add it with the new endpoint.

I have tried :

this.uppy.removePlugin('XHRUpload')
this.uppy.removePlugin({ type: 'uploader', id: 'XHRUpload' })
this.uppy.removePlugin(XHRUpload)

But I either get this error

TypeError: Cannot read property 'slice' of undefined

or

Already found a plugin named 'XHRUpload'. Tried to use: 'XHRUpload'.

Code sandbox : https://codesandbox.io/s/uppy-remove-plugin-nrew1?file=/src/App.vue

doesn't provide an exemple of remove a plugin.

Any ideas ?

Bug Triage

Most helpful comment

You can also try using uppy.getPlugin('XHRUpload').setOptions({ endpoint: 'the new url' }) for that purpose.

uppy.removePlugin() is a bit hard to use … the correct syntax is:

const instance = uppy.getPlugin('XHRUpload')
uppy.removePlugin(instance)

>All comments

You can also try using uppy.getPlugin('XHRUpload').setOptions({ endpoint: 'the new url' }) for that purpose.

uppy.removePlugin() is a bit hard to use … the correct syntax is:

const instance = uppy.getPlugin('XHRUpload')
uppy.removePlugin(instance)
Was this page helpful?
0 / 5 - 0 ratings