React App - XMLhttpRequest Error

Hello my entire Dapp is working, but if I leave my app open, this error appears repeatedly after 30 seconds interval.

Access to XMLHttpRequest at ‘https://internal-api.moralis.io/api/functions/trackEvent’ from origin ‘http://localhost:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
RESTController.js:302 POST https://internal-api.moralis.io/api/functions/trackEvent net::ERR_FAILED 504

I GOT A SIMILAR ERROR ALSO ON ANOTHER DAPP (after 30 seconds)

Failed to load resource: the server responded with a status of 504 ()
POST https://internal-api.moralis.io/api/functions/trackEvent 504

THE ERROR IS ALWAYS ASSOCIATED TO “trackEvent”

2 Likes

Can you provide more details to recreate this error?
Is you app sending multiple API requests when it is idle?

Ok, so there are a lot of thing happening on my Dapp, it’s an NFT staking dapp (image attached) so there’s the metamask login, the contract initialization, the getNFTsForContract api call.
Contract initialization (with abi, web3provider etc) is on the app.js
getNFTsForContract is on a component called Nfts.js
Login metamask on another components

One more question.
Since you are seeing this error after 30 sec, Is it repeating even after you refresh the webpage?
or does the Web3Api stop working completely after this error?

Can you post this on Discord as well - quite a few are having similar problems.

Same problem here also, not a React app, just a Javascript game:

Access to XMLHttpRequest at ‘https://internal-api.moralis.io/api/functions/trackEvent’ from origin ‘https://xxxxxxxxxxxxx’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

It seems yesterday from 9pm this error stopped showing up, today morning here we are again with the error.
The Api continue working without problems and it’s repeating when i refresh the page (after 30 seconds)

You guys found a solution for this? I have the same issue. My app works but these errors are kinda annoying.

I am getting the same errors in my app. App is functioning, but the errors keep logging to the console.

I am also getting the same error.

You can ignore it for now, it going to be fixed soon. It shouldn’t affect any functionality though

For me it actually does. It stops corresponding with my Moralis Dashboard and my login function to MetaMask. Am I alone in this?

It doens’t actually, probably you’re doing something wrong somewhere .