fetch icon indicating copy to clipboard operation
fetch copied to clipboard

this.append is not a function

Open himmelmaus opened this issue 5 years ago • 5 comments

I'm encountering this error when trying to use the latest version image Is this a known issue? I've attempted various rejiggings to see if I am doing something wrong but I cannot see anything - the code I'm using for the fetch is shown below:

fetch("/api/result/csv?export_number=" + encodeURIComponent(export_number), {
        method: "GET",
        credentials: "same-origin",
        headers: {
            "X-CSRFToken": event.target.dataset.csrfToken,
            "Content-Type": "application/json",
            Accept: "application/json",
        },
    })

I originally tried this without the "Content-Type" and "Accept" headers, which seem to make no difference. Any help would be appreciated as I'm stumped, thanks in advance.

ETA: This occurs both on chrome, firefox, and ie 10.

himmelmaus avatar Sep 28 '20 13:09 himmelmaus

@thor174 I don't understand what you mean sorry?

himmelmaus avatar Sep 29 '20 14:09 himmelmaus

@findoslice

try to assign the headers via next way

headers: new Headers({
        "header_name": "header_value"
            })

evheniyrz avatar Apr 30 '21 11:04 evheniyrz

Sure thing @KVROHITH098 - I'm happy to review a PR for this

JakeChampion avatar Jul 23 '21 10:07 JakeChampion