Firebase : site not deployed and empty firebase.json file - firebase

I am trying to set up a very simple website using firebase and the hosting service. I installed node.js v6 following the official instructions provided on their website for Ubuntu. Then I installed firebase and tried to deploy my website following these instructions.
Unfortunately, I ran through several problems.
The firebase login worked fine and the firebase init command appeared to have worked fine too. I then added a very simple index.html file to my folder and then used firebase deploy. The command output told me the website had been successfully deployed, but it was not. The website is not found when I try to reach it with my browser, and the firebase online hosting utility tells me nothing was deployed.
I then checked my firebase.json file and noticed it only contained this :
{}
It's been more than a day now, so I don't think their servers could be that slow at deploying my website, which is very light.
I've tried reinstalling everything, but nothing changed unfortunately...

Related

Firebase hosting public folder alias

I have express, react based existing project that I managed to port to Firebase hosting with cloud functions successfully..at least on the dev server.
It looks like this..
This is running on http://localhost:5000/ with command
firebase serve --only functions,hosting
Now, when I deploy this, it looks like
This is NOT a static site. Following the firebase vid here
https://www.youtube.com/watch?v=LOeioOKUKI8
So I have express server running with
app.use('/static',express.static('../public'));
I had to do this because otherwise, firebase hosting treats each path as public path and it messes up scripts sourcing from public folder and also my react router in react app.
While this works on local server run by firebae, it throws 404 on prod.
Failed to load resource: the server responded with a status of 404 ()
The point is I got all this working on local machine but the deployment just won't oblige.
The deployment was not smooth.
firebase deploy
didn't work.
firebase --only hosting
worked.
firebase --only functions
did not work for quite sometime.
It kept throwing
Error setting up the execution environment for your function. Please try again after a few minutes.
a few times before it finally worked. And I didn't change anything to make it work. Just did it by itself.
Is there something I am missing? I am very new to firebase hosting.
I already have a production site running somewhere and I wish to port it to firebase. But I can not have random 'try again after a few minutes problems'.
But first things first, why are my static files not rendering on prod when they do on dev?
Thanks
Your public directory will need to be nested beneath your functions folder, as only files within the functions folder are deployed to Cloud Functions and available from Node.js.
The local emulator is not actively guarding against this kind of tree navigation, which is why it works locally.
In general, though, you'll likely want to restructure your app a bit so that your static assets are deployed to Firebase Hosting directly rather than being served by Express.

How to deploy google firebase functions using cmd?

I have a problem with a web hosting project. I created a new proyect in google firebase, and I executed the following commands:
C:\myproject>firebase init functions
C:\myproject>firebase deploy --only functions
But the site says this:
Site Not Found
Why am I seeing this?
There are a few potential reasons:
You haven't deployed an app yet.
You may have deployed an empty directory.
This is a custom domain, but we haven't finished setting it up yet.
How can I deploy my first app?
Refer to our hosting documentation to get started.
What could I do for show, at least, some text when an user go to my project url?
The way you now invoke the Firebase CLI, it will only deploy the Cloud Functions in your project. It will not deploy the web site. In fact, the way you've run it, it probably didn't even create a web site to deploy.
Initialize the project with:
firebase init
And answer the questions this shows.
If you want to deploy the web site, use:
firebase deploy --only hosting
More likely you should simply deploy everything to prevent running into this problem:
firebase deploy

NodeJS app works locally but crashes on Heroku

I have problem with my application, which is normally working locally, but when I deploy it on Heroku, then it crashes.
My repo: https://github.com/gkucmierz/cors-proxy
If you search for:
node.js deploy to heroku
You will find that there are certain restrictions to uploading a node.js on heroku.
You should include an application.yml file.
You should include a procfile.
You should modify any interactions with databases to work with postgresql.
I hope I could help.

How do I deploy the polymerfire demo to firebase?

I want to try the demo for polymerfire in firebase. To get it run locally I followed these steps. But what exact steps do I need to do to get it to run in firebase?
I figured firebase init and firebase deploy should be run but the browser only displays errors in the console. Must the polymer project be build in a certain way and what should the firebase "public" folder be?
All files from public folder will be deployed to your Firebase static web hosting, so you can access them though your Firebase hosting address like https://projectname-5gek53.firebaseapp.com/. This allows you to upload your web app.
You build your polymer app (I guess you need to run polymer build). You drag all files generated as production build to your public folder. Next, you run firebase deploy and after deployment process your app will be accessible from your hosting address as I mentioned above.
Edit: Polymerfire demo is actually not that simple to export, but I found a really nice tutorial step-by-step from Google Codelabs here is a link Build a Progressive Web App with Firebase, Polymerfire and Polymer Components
I just installed a new version of the polymer cli and Firebase cli. When I do a Polymer build, no build/bundled or build/unbundled is created.
I do get a build/default, which I can run with a firebase serve and a firebase deploy. So something has changed recently. just fyi

Meteor deployed site always displays "This site is down. Try again later."

I created a meteor app which works fine on my localhost.
I recently just deployed my app to meteors server for testing and each time I visit the app I get a page with the text
This site is down. Try again later.
When I deploy I type:
meteor deploy [app-name]
It deploys successfully but when I actually visit the site, it says it is down.
I’ve tried the following:
Deleting the deployed app and re-uploading, but I experience the same error.
Deploying a brand new meteor app, still says same site is down error.
Deleting the app, reseting my local database with meteor reset, and redeploying. Same error.
Can I do something to fix this, or is this an error with Meteor's servers?
--------------------UPDATE-----------------------
The site is not showing because it is crashing. Using Meteor logs [app-name] I was able to find out that it was crashing because it cannot find module async.
I have my meteor project setup for NPM integration. I used npm install async and use
async = Meteor.require('async')
But I think the issue is with my package.json file.
Here is my current package.json
{
"async": "0.9.0"
}
Is meteor not able to install async on the server because this package.json file is incorrect? Everything works on my localhost but I used npm install async specifically.
----------------------------UPDATE 2-----------------------
I fixed it with the help of this thread:
How can I deploy node modules in a Meteor app on meteor.com?
You have to be a bit careful with NPM modules. meteor deploy doesn't support binary npm or installing npm modules via npm install from a package.json.
This may be what is causing you issues. Unfortunately, there isn't a way passed this. You could use your own server via DigitalOcean or AWS to get passed this.

Resources