adilapapaya
adilapapaya

Reputation: 4795

AngularJS + Firebase Error Failed to load resource: A server with the specified hostname could not be found

I'm following along to the 'Wire Up a Backend' tutorial on the AngularJS webpage and keep getting errors that look something like this:

[Error] Failed to load resource: A server with the specified hostname could not be found https://angularjs-projects.firebaseio.com-jiv-kp7mgi3ituk20hr/.lp?start=t&ser=44599740&cb=1&v=5

It looks like it's related to the Firebase data lookup. More specifically, It's trying to pull the data using the given URL but is coming up empty. What's going on here...? My code is just a copy-paste of the code posted on the site with some modification for the glyphicons since they don't show. I.e.

<span class="glyphicon glyphicon-plus-sign"></span>

instead of

<i class="icon-plus-sign"></i>

Upvotes: 0

Views: 1061

Answers (1)

adilapapaya
adilapapaya

Reputation: 4795

Ha! It turns out the problem was in the
.value(fbURL,'https://angularjs-projects.firebaseio.com/')
line in the project.js file (line no. 3).

Good:

angular.module('project', ['ngRoute', 'firebase'])
//firebase data
.value('fbURL', 'https://angularjs-projects.firebaseio.com/') 

Bad:

angular.module('project', ['ngRoute', 'firebase'])
//firebase data
.value('fbURL', 'https://angularjs-projects.firebaseio.com') 

If you don't have that backslash at the end of your Firebase url, then it's going to load up the wrong URL: https://angularjs-projects.firebaseio.com-jiv-kp7mgi3ituk20hr
instead of
https://angularjs-projects.firebaseio.com/-jiv-kp7mgi3ituk20hr

Still not clear?

It should be

angularjs-projects.firebaseio.com/

and not

angularjs-projects.firebaseio.com

Or, if you've got your own Firebase Firebase, then it's

your-firebase-url/

and not

your-firebase-url

Upvotes: 2

Related Questions