Firebase error.. Error: Failed to make request to https://www.gstatic.com/firebasejs/releases.json
Asked Answered
I

5

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?

Interurban answered 3/3, 2021 at 11:43 Comment(3)
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?Sulphuryl
I can access this link via browser its some sort. json.Interurban
Hmm... I'm not sure why the CLI would then fail on the same machine. I hope someone else spots the problem.Sulphuryl
F
8

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

Fryd answered 27/3, 2021 at 17:45 Comment(0)
P
5

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%

Policlinic answered 15/12, 2021 at 16:49 Comment(1)
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.Unaccomplished
U
2

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

Uncover answered 22/8, 2021 at 22:40 Comment(1)
For me it was fixed after only running npm install -g firebase-tools (which is weird, because it was already installed).Gear
A
0

Try re-login Firebase using the below command:

firebase login --reauth
Antonantone answered 20/2 at 13:2 Comment(0)
D
0

I have tried above all methods but not works for me. But executed below sequence

npm install -g firebase-tools

then

firebase logout

then

firebase login

This would work surly.

Drive answered 20/9 at 12:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.