OP
Hi @Jehanzaib Javed !
I will help you.
Both the Lovable preview and published domains returning a 522 error indicates that the backend (origin server) is not reachable. A 522 is a Cloudflare timeout, not a true CORS issue, and usually means the API server is down, sleeping, misconfigured, or blocked. First, verify that your backend URL opens directly in a browser and responds correctly. Then ensure the backend is publicly accessible over HTTPS and has proper CORS headers allowing the Lovable domains. Once the backend is reachable, the CORS-related messages should resolve automatically.