Sableur
Sableur

Reputation: 256

Firebase default hosting domains: only .firebaseapp.com works but .web.app fails

I'm building a very simple one-page react application using typescript. I tried hosting it using Firebase Hosting. Surprisingly, only the domain [name].firebaseapp.com works but [name].web.app shows the "Site not found" default page:

site-not-found image

I am using a basic firebase config (the default one you get using firebase init):

{
  "hosting": {
    "public": "build",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

I get the "Site not found" when I go on [name].web.app. I would have suspected something was wrong with the index.html, the rewrites, the build folder, etc... but then why would I see the page functional on [name].firebaseapp.com and hosted nicely and it should be?

There is a few things I suspect:

Upvotes: 14

Views: 3239

Answers (3)

mightbesimon
mightbesimon

Reputation: 479

The same weird problem happened to me this weekend. Exact symptoms:

  • before any deployments, I opened example.web.app but not example.firebaseapp.com
  • after the first deployment, example.web.app shows "Site not found" but example.firebaseapp.com works as expected. Consequently my customer domain shows "Site not found" as well.

Per one of the suggestions by support, now fixed by these commands:

curl -X PURGE https://your.notworking.url

For my case, it was just example.web.app and my custom domain. So fixed in 20 seconds.


Suggestions that did NOT work:

  • messing with the browser (clear browser cache, incognito mode etc)
  • re-deploying

Explanation:

The site not found thing got cached on their CDN server. So naturally, clearing local browser cache did not work. Weirdly re-deploying also did not working.

Another helpful note is, in the response there is a x-served-by header, which tells you the CDN server your web app is cached on.

Special thanks to Hugo Varela from firebase support.

Upvotes: 13

BadmanSkinny
BadmanSkinny

Reputation: 39

This solved it for me:

Hard Refresh CTRL + F5 OR Close browser (close all tabs) THEN reopen in a fresh instance.

This looks like a caching issue where the previous version of the code is cached.

Upvotes: 1

Sableur
Sableur

Reputation: 256

Update:

I emailed customer support at firebase, and the next day the domain was working normally. No explanation was provided on why the issue occurred, but emailing them solved it.

Upvotes: 9

Related Questions