I have been trying this - https://codesandbox.io/s/w0nvzjy218 in my desktop with local server. It's been working fine.
But when I moved it to codesandbox platform, on multiple refreshing/loading it crashes as two types of error occur simultaneoulsy.

And I continue solving these issue one after the another as they happen in recursive manner.
Also if you change config in your way, there is response though config is wrong. There is some real issue here with firebase with implementing it with firebase
Thanks for incredible platform!
Heya! You hit a good point: our HMR doesn't work well yet with stateful applications (like with a firebase config). We're working on fixing this here: #313. For now the thing to make it work is to reload the browser window everytime.
I want to work on this issue some more the coming weekend, do you perhaps have a GitHub repo of the project as a real-world test application for CodeSandbox?
@CompuIves No, I don't have the github repo that as I am currently working on that real-world application but I have sandbox - https://codesandbox.io/s/w0nvzjy218 .
Since you said that - for now reloading browser window is the only hack, then I'll keep up with that. Thanks
Quick hack is firebase stores initializations in apps array
Can work around it doing:
if(!firebase.apps.length){
firebase.initializeApp(config);
}
not likely a good production approach but prevents having to refresh for every change in the sandbox
@charlietfl I tried that also, but after one or two attempts, it started showing that error again.
You can now configure your sandbox to do a full reload by creating a sandbox.config.json, that should fix this issue!
Most helpful comment
Quick hack is firebase stores initializations in
appsarrayCan work around it doing:
not likely a good production approach but prevents having to refresh for every change in the sandbox