angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

Is the installation tutorial updated?

Open ix-xerri opened this issue 10 years ago • 28 comments

Hi, I've been trying to get angular fire working but unsuccessful. Is https://github.com/angular/angularfire2/blob/master/docs/1-install-and-setup.md up to date?

I'm trying to use angularfire but can't seem to make it work. I'm using your tutorial and angular-cli.

Also the item shown https://www.youtube.com/watch?v=LdDwbIEpT4s are different. How can firebase init be run? What do I need to install?

ix-xerri avatar Sep 08 '16 17:09 ix-xerri

I also tried to follow the tutorial yesterday but no luck. Crossing finger for an update soon

bjornai avatar Sep 09 '16 06:09 bjornai

Having same issue here

Any thoughts? @jeffbcross @davideast @redian

rememberlenny avatar Sep 09 '16 07:09 rememberlenny

I've been playing around with the tutorials today too. Beeing new to this so kinda feeling lost. Following the instructions, it fails on step 2 for me.

npm install angularfire2 firebase --save

I saw a comment in another issue, that angularfire2 supported rc5. So i opened packages.json and see references to rc.4. Edited these to rc.5 and ran npm install again. After doing that, step 2 worked without errors.

Now I can't find the file /src/app/app.module.ts refered to in step 3 :p

bjornai avatar Sep 09 '16 13:09 bjornai

The installation of angularfire2 and then ng serve work. Everything is package.json is rc5 so all is set. Step 3 and onward did not work.

ix-xerri avatar Sep 09 '16 19:09 ix-xerri

@ix-xerri @baisaksen @rememberlenny It's important to make sure you're on the webpack version of the CLI if you're following that guide.

npm install angular-cli@webpack

davideast avatar Sep 12 '16 16:09 davideast

It is yes. The code generated by angular-cli does not match the code shown in step 3 onward. I am a noob and I just want a hello world using angular and firebase for now.

ix-xerri avatar Sep 12 '16 17:09 ix-xerri

@ix-xerri Are you saying you don't have an app.module.ts file? If so, it would suggest you are not on the latest webpack branch that targets RC6.

Can you upload your code to a repo and link it here?

davideast avatar Sep 12 '16 18:09 davideast

I copied the same code you have in the tutorial and followed it step by step and I get

Module not found: Error: Can't resolve './app/' when I ng serve. Then a large number of Cannot find namespace 'firebase'.

note that in step 5 all the was replaced with "app". I don't see how it can be customisable.

ix-xerri avatar Sep 12 '16 19:09 ix-xerri

@ix-xerri Are you on TypeScript 2.0?

You need to be on the Firebase 3.3 SDK, RC5, TypeScript 2.0, and the Webpack branch of the CLI.

davideast avatar Sep 12 '16 19:09 davideast

yes to all. I just installed everything from scratch as in the tutorial but when I run npm list -g --depth=0 I get

npm ERR! peer dep missing: [email protected], required by @angular/[email protected]
npm ERR! peer dep missing: typescript@^1.9.0-dev, required by @angular/[email protected]
npm ERR! peer dep missing: typescript@^1.9.0-dev, required by @angular/[email protected]
npm ERR! peer dep missing: [email protected] || 2.x.x, required by [email protected]
npm ERR! peer dep missing: @angular/platform-server@^2.0.0-rc.5, required by @angular/[email protected]
npm ERR! peer dep missing: zone.js@^0.6.17, required by @angular/[email protected]
npm ERR! peer dep missing: tslint@^3.0.0, required by [email protected]
npm ERR! peer dep missing: typescript@^1.9.0-dev, required by @angular/[email protected]
npm ERR! peer dep missing: typescript@^1.8.0 || ^1.9.0-dev, required by [email protected]

ix-xerri avatar Sep 12 '16 19:09 ix-xerri

I am stuck on the setup as well. This is the error logged from the chrome console. " Uncaught Error: Cannot find module "./app/" " I have "angularfire2": "^2.0.0-beta.4", "firebase": "^3.3.2".

On step 3, setting up @NgModule, I am a bit unsure of the export class. export class MyAppModule {} I exchanged my app name with MyApp in MyAppModule{} is this correct? If this is the case maybe Module?

PaulSlinky avatar Sep 13 '16 20:09 PaulSlinky

There is now the final version of angular 2.0. Will there be any changes to the tutorial and the dependencies to make it work? Thanks

ix-xerri avatar Sep 15 '16 16:09 ix-xerri

@ix-xerri The installation tutorial is updated now. Try again from the start and everything should work.

mukesh51 avatar Sep 16 '16 21:09 mukesh51

@mukesh51 Really close...all I get is one warning and one error.

WARNING in ./src/main.ts 9:41 export 'AppModule' was not found in './app/'

ERROR in [default] /.../src/main.ts:6:9 Module '"/.../src/app/index"' has no exported member 'AppModule'.

ix-xerri avatar Sep 17 '16 06:09 ix-xerri

@ix-xerri would be good to see your code. can you copy the snippets from app.module.ts, index.ts and main.ts here. Also copy app.component.ts and index.html. Easy option will be to create a plunker.

can you execute this command "ng -v" and paste the output.

mukesh51 avatar Sep 17 '16 09:09 mukesh51

Could not start watchman; falling back to NodeWatcher for file system events. Visit http://ember-cli.com/user-guide/#watchman for more info. angular-cli: 1.0.0-beta.14 node: 6.4.0 os: darwin x64

https://plnkr.co/edit/3jmOKZ?p=catalogue

In app.module.ts the proper firebase config is there not 'xxx'.

ix-xerri avatar Sep 17 '16 15:09 ix-xerri

@ix-xerri Got your problem. You're exporting MyAppModule in /src/app/app.module.ts, but while bootstrapping in /src/main.ts you're using AppModule.

Change "MyAppModule" to "AppModule" in /src/app/app.module.ts and you should be good.

@davideast I'll update the install document.

mukesh51 avatar Sep 17 '16 16:09 mukesh51

ng serve finally works but the app does not load. I get in Chrome console.

url_resolver.js:248Uncaught TypeError: uri.match is not a function_split @ url_resolver.js:248getUrlScheme @ url_resolver.js:91componentModuleUrl @ metadata_resolver.js:708CompileMetadataResolver.getDirectiveMetadata @ metadata_resolver.js:148(anonymous function) @ metadata_resolver.js:271CompileMetadataResolver.getNgModuleMetadata @ metadata_resolver.js:265RuntimeCompiler.compileComponents @ runtime_compiler.js:126RuntimeCompiler.compileModuleAndComponents @ runtime_compiler.js:64RuntimeCompiler.compileModuleAsync @ runtime_compiler.js:55PlatformRef.bootstrapModuleWithZone @ application_ref.js:303PlatformRef.bootstrapModule @ application_ref.js:285(anonymous function) @ main.ts:12__webpack_require_ @ bootstrap db62fc2…:52(anonymous function) @ main.bundle.js:60940__webpack_require__ @ bootstrap db62fc2…:52webpackJsonpCallback @ bootstrap db62fc2…:23(anonymous function) @ main.bundle.js:1

ix-xerri avatar Sep 17 '16 16:09 ix-xerri

@ix-xerri I get the same error in Safari.

TypeError: uri.match is not a function. (In 'uri.match(_splitRe)', 'uri.match' is undefined)

iamgmd avatar Sep 18 '16 12:09 iamgmd

@ix-xerri @iamgmd Remove 'moduleId: module.id' from your src/app/app,component.ts and the error should go away. Let me know how it goes.

mukesh51 avatar Sep 18 '16 18:09 mukesh51