Infura Rejecting Localhost CORS

Hey all,

I’m not sure if I’m taking crazy pills or not, but it seems like Infura is working intermittently when developing locally. At times when using infura that the api seems to be working fine from localhost with requests successfully being made. On other occasions, Infura is responding with a no CORS from localhost allowed on the requested resource:

No 'Access-Control-Allow-Origin' header is present on the requested resource.

This would lead me to believe that requests from localhost should never have worked! Hence the crazy pills.

Has anyone else run into this? Is it the case that running into an API limit might trigger this error? Any help is appreciated!

Hey @Dylan, and welcome to the Infura community!

Which library (if any) are you using for this? We’ve had other users in the past who have run into this when using ethers.js and solved it by removing the secret if they have one.