Stuck in CORS error

I am new to coding. I created an app and tried to connect it with firestore database. But I am stuck at CORS error since many days. I am using Firebase AI studio to make the app.

Hi @divij_goyal,

Don’t use fetch() or axios() to call firestore directly – this cause CORS issues.
Instead, use the Firebase Web SDK which handles CORS and authentication for you automatically.

You can also use these documents for your reference

Firebase setup docs

Get started with Cloud Firestore

Firebase Studio Troubleshooting Guide

Stack Overflow: CORS on Firebase Storage