Search code examples
reactjsfirebasefirebase-tools

How to host React app with Firebase emulator


I am trying to get an already functioning webapp with firebase deployment going on a new pc, I am using VS code with Node on Windows. When I run yarn start, it executed fine on the port 3000. When I use firebase emulators:start on some port, for example 5033 it doesn't show anything. I am using "hosting": { "public": "public", in the firebase configuration file. My question is what should I do to make the functioning React app be hosted on a firebase emulator? Maybe I should change something in the index.html in the public folder, but I have no clue. I am new to web development, so detailed explanations would be greatly appreciated.

When firebase emulators:start is running I get URIError: URI malformed in the terminal


Solution

  • So I think I figured out at least partially how to solve it and the app works. It seems the problem was with the build folder. After using yarn build and firebase deploy it finally worked as expected. After firebase init the build folder was overwritten. No idea, why it didn't work out at all, I guess I've changed something in the build. Anyway take care to build the folder which is then deployed with Firebase.