question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FilePond.setOptions is not a function

See original GitHub issue

Summary

I can’t seem to use this syntax when using vue-filepound with typescript to set a custom process function

FilePond.setOptions({
    server: {
		process(fieldName: any, file: any, metadata: any, load: any, error: any, progress: any, abort: any) {

			// fieldName is the name of the input field
			// file is the actual file object to send
			console.log(fieldName, file, file.name);
			
			
			// Should expose an abort method so the request can be cancelled
			return {
			  abort: () => {
				// Let FilePond know the request has been cancelled
				abort();
			  },
			};
		}

    }
});

I am getting the error FilePond.setOptions is not a function

How to reproduce

try to use FilePond.setOptions(); on a vue sigle file compoenet

Expected behavior

Set a custom process function that doesn’t upload the files anywhere.

Additional information

Environment Version
OS Windows 10
Browser Chrome

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

30reactions
rikschenninkcommented, Oct 26, 2018

I’m sorry, made a mistake, vueFilePond is a default export while setOptions is a named export.

I’ve run a quick test and the following works:

import vueFilePond, { setOptions } from 'vue-filepond';

setOptions({
  labelIdle: 'hello!'
})

I’m not very familiar with TypeScript so if you are, PRs are welcome.

6reactions
rikschenninkcommented, Oct 26, 2018

With Vue FilePond is a component so this doesn’t work.

This should work:

import { vueFilePond, setOptions } from 'vue-filepond';

setOptions({
    server: { ... }
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

FilePond Documentation - PQINA
Connecting to a server​​ We'll use the setOptions method to overwrite default server options for all FilePond instances on the page. In the...
Read more >
FilePond override server.process on React - Stack Overflow
handleInit()} to the component. But, trying to call this.pond.setOptions fails with this.pond.setOptions is not a function. – Andrew Kennel.
Read more >
How to use the filepond.supported function in filepond - Snyk
To help you get started, we've selected a few filepond.supported examples, ... Do this once const isSupported: boolean = supported(); // Methods not...
Read more >
Livewire FilePond Clear after upload - Laracasts
Livewire FilePond Clear after upload ... setOptions({ server: { process: (fieldName, file, metadata, load, error, ... removeFile is not a function.
Read more >
Filepond: A Flexible and Fun JavaScript File Upload Library
Responsive, automatically scales to available space, is functional on both mobile and desktop ... At the moment test coverage is not great, it's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found