12

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:

  • The domain name is not available from firebase itself (although why would firebase name the domain something that is invalid if that was the case when creating the project)
  • The files are being pushed to the [name].firebaseapp.com domain only (in that case, how can you control that?)
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Sableur
  • 236
  • 1
  • 10
  • *firebaser here* That sounds unusual, as the two subdomains are mapped to the same resources. It's literally a single deploy with two DNS mappings. You might want to try running `firebase deploy` again just in case, but it that doesn't work, [reach out to Firebase support](https://firebase.google.com/support/contact/troubleshooting/) for personalized help in troubleshooting. – Frank van Puffelen Apr 13 '21 at 14:14
  • 5
    @FrankvanPuffelen thanks for the confirmation that it's an unusual behavior. I totally agree with your comment about it being a single deploy and just two DNS mappings. Running ```firebase deploy``` again does not work. I will reach out to the support and update the thread with what they answer. Thanks! – Sableur Apr 13 '21 at 23:12
  • I got this same issue, really weird... It worked the next day even without contacting support. May be some proxy-caching issue at firebase – Alve Jul 22 '21 at 15:33
  • Same here. https://thazhamburrising.firebaseapp.com/ works, https://thazhamburrising.web.app/ doesn't work. Waited for 12 hours. Let me wait for another 12 hours before contacting support. – saiy2k Oct 04 '21 at 05:38
  • Same issue here. I have a feeling it was because I opened the domain before anything was deployed and it cached the "Site Not Found" page. I'll wait 12 hours and see if it gets fixed. https://johannes-nicholas.firebaseapp.com/ Works. https://johannes-nicholas.web.app/ Does not work. – Joey Nicholas Jun 19 '22 at 01:14

3 Answers3

9

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.

Sableur
  • 236
  • 1
  • 10
  • 1
    This works and I don't know why. I am not sure if it is interfered by the support team. Maybe it is casused by some very slow process(like propagation). But my issue is solved within 12h or less. – Pablo LION Sep 29 '21 at 20:28
  • Firebase Support is awful. I've had to contact support several times because I've waited weeks and they didn't respond back. Once they finally responded, they give the generic "clear the cache and test on Incognito window" which I already did, emailed them back, and they didn't even respond, so I had to contact support again! Awful customer support. – Jack Murrow Jul 27 '22 at 17:21
9

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.

mightbesimon
  • 380
  • 3
  • 7
  • 1
    hi @mightbesimon. this solution makes sense, thanks for explaining. I will mark it as the "accepted" solution so others read it and do as you said above. – Sableur Dec 01 '22 at 19:40
1

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.

  • 1
    hey, unfortunately in my case even retrying on a different device with a clean setup did not work. Must have been CDN caching as mentioned by @mightbesimon below – Sableur Dec 01 '22 at 19:41