Skip to content

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

Open
@gustavosubastas

Description

@gustavosubastas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions