Search code examples
firebasefirebase-hostingfirebase-cli

Firebase hosting case-sensitive works in local but not when hosted


I am using Firebase Hosting. Hosting it in local for testing via command

firebase serve --only hosting

This hosts all files fine irrespective of the case mismatch in the urls.

Once this is Hosted onto Firebase, all the case-sensitive links are broken. I know Firebase is case-sensitive, but how does it work in local hosting?

This would make no sense of local testing if it fails after Hosting on to cloud.


Solution

  • If you're working with Windows or a Macos filesystem that isn't case sensitive, then the emulator probably isn't going to discern between FOO.HTML and foo.html, since the operating system thinks they're essentially the same. Your code should always respect case, regardless of what system is hosting it - Firebase Hosting in production requires it.