Cant find the name Provider error while using firebase in ionic 2


#1

Please help me with this error

I have used firebase and getting this error:
I have created the folder firebase ,but also getting the errors,




the list is very long,i hope you might have got the idea.

Thanks


#2

Please don’t ever post screenshots again, instead post errors formatted with < / > code styling :wink: It makes your issue much better readable. As regarding to your problem, it clearly says it can’t find firebase namespace, which means it doesn’t know the firebase namespace (doh). You say you’ve ‘created’ the folder firebase, what do you mean by that? How did you install firebase? Could you also post the contents of your package.json over here?


#3

I will take care of not posting the screenshot again.Thanks a for the
advice.I have installed the firebase by using the command : npm install
firebase through which I got folder firebase .


#4

contents of package.json:
{ “name”: “Bill”, “version”: “0.0.1”, “author”: “Ionic Framework”, “homepage”: “http://ionicframework.com/”, “private”: true, “scripts”: { “clean”: “ionic-app-scripts clean”, “build”: “ionic-app-scripts build”, “lint”: “ionic-app-scripts lint”, “ionic:build”: “ionic-app-scripts build”, “ionic:serve”: “ionic-app-scripts serve” }, “dependencies”: { “@angular/common”: “4.1.0”, “@angular/compiler”: “4.1.0”, “@angular/compiler-cli”: “4.1.0”, “@angular/core”: “4.1.0”, “@angular/forms”: “4.1.0”, “@angular/http”: “4.1.0”, “@angular/platform-browser”: “4.1.0”, “@angular/platform-browser-dynamic”: “4.1.0”, “@ionic-native/core”: “3.7.0”, “@ionic-native/splash-screen”: “3.7.0”, “@ionic-native/status-bar”: “3.7.0”, “@ionic/storage”: “2.0.1”, “angular2-moment”: “^1.3.3”, “ionic-angular”: “3.2.1”, “ionicons”: “3.0.0”, “rxjs”: “5.1.1”, “sw-toolbox”: “3.6.0”, “zone.js”: “0.8.10” }, “devDependencies”: { “@ionic/app-scripts”: “1.3.7”, “@ionic/cli-plugin-cordova”: “1.0.0-alpha.f2ecbc05”, “@ionic/cli-plugin-ionic-angular”: “1.0.0-alpha.f2ecbc05”, “typescript”: “2.2.1” }, “description”: “An Ionic project”}


#5

Please format your code, because now it’s unreadable. I do notice I don’t see firebase, nor angularfire2 (which probably explains why you’re missing typings).

please install angularfire2 by running following command:

> npm install firebase angularfire2 --save

This will also install firebase.


#6

Sorry for the inconvenience…,

now firebase is installed:
but getting the same error:
Please help in this.

{
“name”: “todoer”,
“version”: “0.0.1”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true, “scripts”:
{
“clean”: “ionic-app-scripts clean”,
“build”: “ionic-app-scripts build”,
“lint”: “ionic-app-scripts lint”,
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
}, “dependencies”:
{ “@angular/common”: “4.1.0”,
"@angular/compiler": “4.1.0”,
"@angular/compiler-cli": “4.1.0”,
"@angular/core": “4.1.0”,
"@angular/forms": “4.1.0”,
"@angular/http": “4.1.0”,
"@angular/platform-browser": “4.1.0”,
"@angular/platform-browser-dynamic": “4.1.0”,
"@ionic-native/core": “3.7.0”,
"@ionic-native/splash-screen": “3.7.0”,
"@ionic-native/status-bar": “3.7.0”,
"@ionic/storage": “2.0.1”,
“firebase”: “^3.9.0”,
“ionic-angular”: “3.2.1”,
“ionicons”: “3.0.0”,
“rxjs”: “5.1.1”,
“sw-toolbox”: “3.6.0”,
“zone.js”: “0.8.10”
},
“devDependencies”:
{
"@ionic/app-scripts": “1.3.7”,

@ionic/cli-plugin-cordova”: “1.0.0-alpha.f2ecbc05”,
"@ionic/cli-plugin-ionic-angular": “1.0.0-alpha.f2ecbc05”,
“typescript”: “2.2.1”
},
“description”: “An Ionic project”
}
Thanks:)


#7

First of all, you’re code still isn’t formatted. Use the < /> button in this editor to format your code properly. Also I don’t see any error message. Probably it got lost because you didn’t include it in code brackets. Please check your posts after posting or use the previewer on the right hand side to see how your post is going to look, it makes our lives a lot easier :slight_smile:


#8
{ 
 "name": "todoer", 
 "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/", 
 "private": true,  "scripts":
 {
  "clean": "ionic-app-scripts clean",
  "build": "ionic-app-scripts build",
  "lint": "ionic-app-scripts lint", 
 "ionic:build": "ionic-app-scripts build", 
   "ionic:serve": "ionic-app-scripts serve" 
 },  "dependencies":
 {    "@angular/common": "4.1.0", 
 "@angular/compiler": "4.1.0",
  "@angular/compiler-cli": "4.1.0", 
 "@angular/core": "4.1.0",  
"@angular/forms": "4.1.0",
  "@angular/http": "4.1.0",  
"@angular/platform-browser": "4.1.0", 
   "@angular/platform-browser-dynamic": "4.1.0", 
 "@ionic-native/core": "3.7.0", 
   "@ionic-native/splash-screen": "3.7.0", 
 "@ionic-native/status-bar": "3.7.0",  
"@ionic/storage": "2.0.1",
  "firebase": "^3.9.0",  
"ionic-angular": "3.2.1",  
"ionicons": "3.0.0",
  "rxjs": "5.1.1",
  "sw-toolbox": "3.6.0", 
 "zone.js": "0.8.10" 
 },
"devDependencies":
 { 
   "@ionic/app-scripts": "1.3.7", 

   "@ionic/cli-plugin-cordova": "1.0.0-alpha.f2ecbc05",
  "@ionic/cli-plugin-ionic-angular": "1.0.0-alpha.f2ecbc05",  
"typescript": "2.2.1"
  },
"description": "An Ionic project"
}
The error is:
(UNCAUGHT IN PROMISE) :TYPE ERROR
FIREBASE IS UNDEFINED DATA PROVIDER..



#9

Okay I think you just need to read up on some documentation and try it yourself first. I’ll provide an excellent tutorial on how ton integrate this stuff into Ionic. You can find it over here:

https://github.com/angular/angularfire2/blob/master/docs/Auth-with-Ionic3-Angular4.md


#10

Thanks ,I will refer this …and will get back to you if got struck somewhere.