TypeError - Class extends value #<Object> is not a constructor or null

I built a proxy server with netlify function.
It worked well at local development environment.
But after deployment, this error occurred.
I’m not sure if the problem is from fetch-blob or netlify function, but I’m asking here because it worked well at local.

Can anyone help with this?

Hi @Chun-gu,

It is possible the problem is with the fetch-blob package in a serverless environment.

fetch-blob is a Blob implementation in Node.js, originally from node-fetch.

Try out the alternative package node-fetch to see if it helps resolves the problem.

If the suggestions above does not help, kindly take your time and make sure you go through the API of blob-fetch to make sure you are not missing anything.

Let me know the outcome.

Thanks.

@clarnx, they’re already using node-fetch: liontime-api-redirect/index.js at main · Chun-gu/liontime-api-redirect · GitHub

I can see this happen with @jacobus91 in this thread too: Netlify Fetch Function Works Locally, Returns 502 Error Deployed. Even they are using node-fetch and getting the exact same issue.

@Chun-gu and @jacobus91, could you try using axios to see if it helps? But, please use Axios v1.1.3 or lower as v1.2.0 of Axios currently has a different bug: Error response data nodejs · Issue #5298 · axios/axios · GitHub