1

I am trying to deploy my react app to Firebase (using firebase-tools).

The app was generated using this generator (which has deployment instructions in the readme). I followed them, but they didn't flag that Firebase overrides the index html, so they initial step replaced my html in the build file with the Firebase override. I copied my src/index.html back to the build file and re-ran the init, build and deploy calls.

I have an intercom script on the home page - the only part of the page that renders is the intercom icon. The rest of the page is blank.

I have seen this post. Like this user, I had to remove the predeploy script from my firebase.json because it was generating eslint errors.

The facebook create-react-app advice for Firebase hosting is to add an additional script to the firebase.json with:

"headers": [
      {"source": "/service-worker.js", "headers": [{"key": "Cache-Control", "value": "no-cache"}]}
    ],

I also tried this, but it doesn't change anything.

I tried removing, reinstalling npm and then cleaning the cache (in the functions folder). I have noticed that reinstalling node modules does not result in a functions/node_modules/eslint folder. I'm not sure why.

Others have suggested chrome/devtools/application/clear storage/clear site data. I have tried it but nothing changes.

Some posts attribute the problem to firebase-tools - although more recent posts suggest that the error that gave rise to that solution has now been remedied.

Has anyone found a solution for this problem?

Mel
  • 2,481
  • 26
  • 113
  • 273

1 Answers1

0

In firebase.json - change public from 'build' to 'dist'

"hosting": { "public": "dist",

Mel
  • 2,481
  • 26
  • 113
  • 273