Skip to content
Advertisement

Getting blank page when React App is deployed and hosted by firebase

I am getting a blank page when I go to my website domain after deploying it through firebase – I know what I did wrong which was I said (yes) to the option of overwriting my index/html file when running firebase init.

I have tried to solve it through various methods, I have replaced the index.html file in the build folder that firebase produced with my original and added in the required base and script tags so now at least the blank page loading and the React App name and sign in tab shows that it is loading it up. However the contents aren’t displaying.

I have tried changing my firebase.json to [“hosting”: {“public”: “dist”,] as it was originally [“hosting”: {“public”: “build”,] however this has not worked as I get this error on the cmd: Error: Specified public directory ‘dist’ does not exist, can’t deploy hosting to site…

Relevant code is below if you need any more snippet please comment so.

Build/index.html

JavaScript

firebase.json

JavaScript

package.json (not sure if you need it)

JavaScript

Advertisement

Answer

You should select ‘N’ while rewriting URLs to index.html.

So, I suggest you redo the firebase initialization.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement