Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Object literal may only specify known properties, and 'patch' does not exist in type #932

Open
2 tasks done
gustavosubastas opened this issue Aug 31, 2023 · 0 comments
Labels

Comments

@gustavosubastas
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated FilePond and its plugins?

  • I have updated FilePond and its plugins

Describe the bug

I found this error on typescript

"version": "4.30.4",
my code

const pond = FilePond.create(element, {
    required: false,
    maxFiles: 1,
    name: 'filepond',
    allowFileTypeValidation: true,
    acceptedFileTypes: ['video/mp4'],
    labelFileTypeNotAllowed: 'Tipo de archivo no válido',
    minFileSize: "1KB",
    maxFileSize: "50MB",
    labelMaxFileSizeExceeded: "Video demasiado grande",
    credits: false,
    chunkUploads: true,
    server: {
        headers: {
            "X-CSRFToken": csr_token_input ? csr_token_input.value : ""
        },
        url: window.location.origin + '/fp',
        process: {
            url: '/process/',
            method: 'POST',
            withCredentials: false,
        },
        revert: '/revert/',
        patch: '/patch/'

    }
}

Type '{ headers: { "X-CSRFToken": string; }; url: string; process: { url: string; method: "POST"; withCredentials: false; }; revert: string; patch: string; }' is not assignable to type 'string | { url?: string | undefined; timeout?: number | undefined; headers?: { [key: string]: string | number | boolean; } | undefined; process?: string | ServerUrl | ProcessServerConfigFunction | null | undefined; ... 4 more ...; remove?: RemoveServerConfigFunction | ... 1 more ... | undefined; } | null | undefined'.
Object literal may only specify known properties, and 'patch' does not exist in type '{ url?: string | undefined; timeout?: number | undefined; headers?: { [key: string]: string | number | boolean; } | undefined; process?: string | ServerUrl | ProcessServerConfigFunction | null | undefined; ... 4 more ...; remove?: RemoveServerConfigFunction | ... 1 more ... | undefined; }'.ts(2322)

It work but patch is red :(

Reproduction

just add patch in server configuration and work with typescript

const pond = FilePond.create(element, {
    required: false,
    maxFiles: 1,
    name: 'filepond',
    allowFileTypeValidation: true,
    acceptedFileTypes: ['video/mp4'],
    labelFileTypeNotAllowed: 'Tipo de archivo no válido',
    minFileSize: "1KB",
    maxFileSize: "50MB",
    labelMaxFileSizeExceeded: "Video demasiado grande",
    credits: false,
    chunkUploads: true,
    server: {
        headers: {
            "X-CSRFToken": csr_token_input ? csr_token_input.value : ""
        },
        url: window.location.origin + '/fp',
        process: {
            url: '/process/',
            method: 'POST',
            withCredentials: false,
        },
        revert: '/revert/',
        patch: '/patch/'

    }
}

Environment

- Device: PC
- OS: Linux
- Browser: Brave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant