react app not deployed correctly with firebase

Viewed 706

This my first time deploying a react app with firebase and after seeing a few tutorials I still get the same result . When I click on my firebase url to my website I get this pic instead of my website : enter image description here

I followed the steps below :

1)cd to my react app 
2) npm install firebase-tools -g 
3)firebase login 
4) firebase init 
   -hosting setup 
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
 File build /index.html already exists. Overwrite? No
  Skipping write of build /index.html
5) npm run build 
6) firebase deploy 

So the deployment is succesfull but I do not get my app but this screen instead .

1 Answers

I suggest reviewing the documentation:

Specify a directory to use as your public root directory.

This directory contains all your publicly served static files, including your index.html file and any other assets that you want to deploy to Firebase Hosting.

The default for the public root directory is called public.

You can specify your public root directory now or you can specify it later in your firebase.json configuration file.

If you select the default and don't already have a directory called public, Firebase creates it for you.

If you don't already have a valid index.html file or 404.html file in your public root directory, Firebase creates them for you.

You created a public folder called "build", but you didn't put your app code in it. It contains default content, as described by the documentation. You will have to remove that default content and add your own. Then, deploy again.

Related