8

I am deploying my React app to firebase hosting. when I create firebase init and select all options I am getting this error.

C:\Users\user\git\Apps\screem>firebase init

     ######## #### ########  ######## ########     ###     ######  ########
     ##        ##  ##     ## ##       ##     ##  ##   ##  ##       ##
     ######    ##  ########  ######   ########  #########  ######  ######
     ##        ##  ##    ##  ##       ##     ## ##     ##       ## ##
     ##       #### ##     ## ######## ########  ##     ##  ######  ########

You're about to initialize a Firebase project in this directory:

  C:\Users\user\git\Apps\screem

? Are you ready to proceed? Yes
? Which Firebase CLI features do you want to set up for this folder? Press Space to select features, then Enter to confi
rm your choices. Hosting: Configure and deploy Firebase Hosting sites

=== Project Setup

First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.

? Please select an option: Use an existing project
? Select a default Firebase project for this directory: screem-59e13 (screem)
i  Using project screem-59e13 (screem)

=== Hosting Setup

Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.

? What do you want to use as your public directory? build
? Configure as a single-page app (rewrite all urls to /index.html)? Yes
? Set up automatic builds and deploys with GitHub? No

Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json

Any idea how to fix this?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
SUHEL MAKKAD
  • 100
  • 2
  • 5
  • It looks like the `firebase` command is having trouble loading some of the dynamic data it needs from `https://www.gstatic.com/firebasejs/releases.json`. If you rerun the command, do you get the same error? If so, can you check if you can open the URL directly in a browser? – Frank van Puffelen Mar 03 '21 at 14:52
  • I can access this link via browser its some sort. json. – SUHEL MAKKAD Mar 03 '21 at 17:36
  • Hmm... I'm not sure why the CLI would then fail on the same machine. I hope someone else spots the problem. – Frank van Puffelen Mar 03 '21 at 17:39

3 Answers3

7

In order to understand the root cause of the error, try running the Firebase init command with the debug option:

firebase init --debug

It is possible that the request fails due to a "self-signed certificate in the certificate chain". If so, you will see this error in the debug output and then you can refer to this StackOverflow question for ways to workaround or fix the issue: nodejs - error self signed certificate in certificate chain

chipilov
  • 509
  • 3
  • 8
3

Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json

to solve this problem run this command:

firebase init --debug

it will work 100%

PR7
  • 1,524
  • 1
  • 13
  • 24
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 15 '21 at 21:33
1

This worked for me. Run npm install -g firebase-tools before running the command firebase init.

GILO
  • 2,444
  • 21
  • 47