elbywan / wretch

A tiny wrapper built around fetch with an intuitive syntax. :candy:
MIT License
4.83k stars 98 forks source link

"(intermediate value)(...)(...) is not a function" #72

Closed JustinLutsky closed 4 years ago

JustinLutsky commented 4 years ago

Any idea why I'd be getting:

"(intermediate value)(...)(...) is not a function"

calling...

        let res = await request.post(body).text();
        res = JSON.parse(res.replace(/^\ufeff/g, ''));
        return res;

Works fine testing locally with ts-node, but throwing error after deploying to AWS lambda.

determin1st commented 4 years ago

you dont need to remove special BOM markers and stuff there, modern browser's api does it anyway so..

also, the post method may be detected automatically.. as far as response data be parsed to proper content-type.

elbywan commented 4 years ago

Hi @JustinLutsky,

Any idea why I'd be getting: (…)

No idea, sorry 😕. The code snippet looks ok to me. I'm not sure it's related to the wretch library.