saveIPFS() returns CORS policy error

Whenever I call saveIPFS() to upload a file I am returned the following:

Access to XMLHttpRequest at ‘’ from origin ‘http://localhost:2526’ has been blocked by CORS policy

Here’s the sample code and console response:

This was working for me yesterday, and I do not think I have changed related to this functionality in my code. I have tried updating to the latest moralis and react-moralis SDKs in my package.json npm file, as well as I just performed a restart+update on my server but the issue remains the same. This seemed to have just started yesterday.

In package.json I have tried with
moralis": “^0.0.138” as well as moralis": “^0.0.165”
and a few different versions of “react-moralis” package.

I did some searching in the forum and I found this: Sudden CORS errors but I wasn’t sure if I am experiencing the same/related backend issue or if there’s just some silly issue on my local devices/dependancies which I need to debug further.

Any next steps or direction on where to troubleshoot further would be appreciated! :pray:

do you get that error instantly or after a period of time like a timeout?

you could also try to upload from a cloud function now:

It is after some time the server responds to the browser with the CORS blocked error. Now that I look closer in my repro, this looks like a potential 60 second timeout, here’s the duration it took to respond:

you get CORS errors in case of timeout

Okay, thanks for confirming. I am still not sure why the server timeout is happening, though. The metadata file I am uploading is only a few kb in size so the backend should be able to process that within 60 seconds. And I had this was working yesterday with the same file so it seems odd.

I can explore the Moralis.Cloud.toIpfs method you linked above and report back how that goes, but I am still curious why this saveIPFS() is not working.