0

I'm trying to deploy my react app on firebase but i get this error:

Error: Failed to list Firebase projects. See firebase-debug.log for more info.

and in the firebase-debug.log file this shows:

[info] First, let's associate this project directory with a Firebase project.

[info] You can create multiple project aliases by running firebase use --add,

[info] but for now we'll just set up a default project.

[info] [debug] [2021-03-20T19:18:31.200Z] > refreshing access token with scopes: []

[debug] [2021-03-20T19:18:31.202Z] >>> HTTP REQUEST POST https://www.googleapis.com/oauth2/v3/token

[debug] [2021-03-20T19:18:32.948Z] <<< HTTP RESPONSE 200 {"expires":"Mon, 01 Jan 1990 00:00:00 GMT","cache-control":"no-cache, no-store, max-age=0, must-revalidate","date":"Sat, 20 Mar 2021 19:18:28 GMT","pragma":"no-cache","content-type":"application/json; charset=utf-8","vary":"X-Origin, Referer, Origin,Accept-Encoding","server":"scaffolding on HTTPServer2","x-xss-protection":"0","x-frame-options":"SAMEORIGIN","x-content-type-options":"nosniff","alt-svc":"h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"","accept-ranges":"none","transfer-encoding":"chunked"} [debug] [2021-03-20T19:18:33.023Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=100

[debug] [2021-03-20T19:18:35.619Z] Failed to make request: invalid json response body at https://firebase.googleapis.com/v1beta1/projects?pageSize=100 reason: Unexpected token < in JSON at position 0

[debug] [2021-03-20T19:18:37.235Z] FirebaseError: Failed to make request: invalid json response body at https://firebase.googleapis.com/v1beta1/projects?pageSize=100 reason: Unexpected token < in JSON at position 0 at Client.request (C:\Users\john tucker\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:109:19) at processTicksAndRejections (internal/process/task_queues.js:97:5)

[error] [error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.

I have already tried to logout and login and made sure that my app exists in the firebase console .

I also get this error when I type firebase init in the terminal :

(node:12720) UnhandledPromiseRejectionWarning: FirebaseError: Failed to make request to https://firebase-public.firebaseio.com/cli.json at Client.doRequest (C:\Users\john tucker\AppData\Roaming\npm\node_modules\firebase-tools\lib\apiv2.js:211:19) at processTicksAndRejections (internal/process/task_queues.js:97:5)

(node:12720) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

(node:12720) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

1 Answer 1

0

You have to follow this steps to deploy your react app online with fire-base hosting :

    npm run build => Run the following command to create a build directory with a production build of your app
 
    npm install -g firebase-tools => To host your site with Firebase Hosting, you need the Firebase command-line tool (CLI). Run the following npm command to install the CLI on your system globally

    firebase login => If you're not logged in, you'll be asked to enter the credentials for your google account.

    firebase init => to initialize firebase in your react app

    firebase deploy => Firebase will now run the deploying process and will give you a unique URL where your app is deployed
Sign up to request clarification or add additional context in comments.

1 Comment

thank you dear sir for taking the time to help , i did exactly what you said but i got the same error again and when i type : firebase init , this comes out on the terminal please look again at the post because the error showing in the terminal didn't fit here :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.