Can't use firebase, firestore Initialize throwing CORS error:

Note: Just a beginner, so the question may sound stupid to you.

The Firestore (or Firebase in general) never throws any error, but strangely enough, the simple initialize request is causing this.

Error at tab1:1

Access to XMLHttpRequest at ‘https://firestore.googleapis.com/google.firestore.v1.Firestore/Write/channel?database=projects%2Frecipe-595e2%2Fdatabases%2F(default)&VER=8&RID=29964&CVER=22&X-HTTP-Session-Id=gsessionid&%24httpHeaders=X-Goog-Api-Client%3Agl-js%2F%20fire%2F7.4.0 &zx=il9z8prfbzqm&t=1’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: The value of the ‘Access-Control-Allow-Origin’ header in the response must not be the wildcard ‘*’ when the request’s credentials mode is ‘include’. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

I have included the firebase config in environment file and have initialized it like this in app.module.ts

import { AngularFireModule } from '@angular/fire';
import { AngularFirestoreModule, FirestoreSettingsToken } from '@angular/fire/firestore';
...
imports: [
AngularFireModule.initializeApp(environment.firebase),
    AngularFirestoreModule.enablePersistence()
]

My ionic info:

Ionic:

   Ionic CLI                     : 5.4.2 (C:\Users\username\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.11.5
   @angular-devkit/build-angular : 0.801.3
   @angular-devkit/schematics    : 8.1.3
   @angular/cli                  : 8.1.3
   @ionic/angular-toolkit        : 2.1.1

Utility:

   cordova-res : 0.8.0
   native-run  : 0.2.8

System:

   NodeJS : v10.16.3 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

It’s embarrassing that I can’t even get started with a simple crud app.

You can refer to these 2 articles for solving CORS issue

  1. :- using gsutil tool to set ur firebase config
  2. :- Article by Josh Morony