Skip to content

FormData binding problem #37

@FilipKittnar

Description

@FilipKittnar

Hello,
I tried the recently added FormData binding in a ReScript project exactly according to your example with appendObject and it doesn't work. The problem is that the JS snippet it generated looks like this:

              var formData = new FormData();
              formData.append("image", {
                    type: "image/jpeg",
                    uri: photoUri,
                    name: "image.jpg"
                  }, undefined);

The undefined as the third parameter is the problem. There must be no third parameter, not even undefined. If I remove it from the gerenated JS file, it works correctly.
If I understand the FormData API correctly the third parameter (filename) is used only for Blobs and Files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions