follow the installation guide and run fine in angular cli ...thanks.. :)
but When attempting to use the AngularFire2 guide in ionic beta facing the cli error .....
also include "files" array in the tsconfig.json file.
"files": [
"node_modules/angularfire2/firebase3.d.ts"
],
E:firebase v3ionic2-angularfire-sample>ionic serve
`
Running 'serve:before' gulp task before serve
..............
TypeScript error: E:/firebase v3/ionic2-angularfire-sample/app/pages/home/home.t
s(42,47): Error TS2339: Property 'displayName' does not exist on type 'TwitterCr
edential'.
TypeScript error: E:/firebase v3/ionic2-angularfire-sample/node_modules/angularf
ire2/database/database.d.ts(10,31): Error TS2503: Cannot find namespace 'firebas
e'.
TypeScript error: app/app.ts(18,25): Error TS2345: Argument of type 'string' is
not assignable to parameter of type 'FirebaseAppConfig'.
[01:28:03] Finished 'watch' after 32 s
[01:28:03] Starting 'serve:before'...
[01:28:03] Finished 'serve:before' after 21 μs
Running live reload server: http://localhost:35729
Watching: www//, !www/lib//
√ Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $ 10.5 MB bytes written (37.19 seconds)
TypeScript error: E:/firebase v3/ionic2-angularfire-sample/app/pages/home/home.t
s(42,47): Error TS2339: Property 'displayName' does not exist on type 'TwitterCr
edential'.
TypeScript error: E:/firebase v3/ionic2-angularfire-sample/node_modules/angularf
ire2/database/database.d.ts(9,29): Error TS2503: Cannot find namespace 'firebase
'.......
TypeScript error: app/app.ts(18,25): Error TS2345: Argument of type 'string' is
not assignable to parameter of type 'FirebaseAppConfig'.
10.5 MB bytes written (3.66 seconds)
firebase v3ionic2-angularfire-sample>typings install --save --ambient firebase
typings ERR! deprecated The "ambient" flag is deprecated. Please use "global" in
stead
E:firebase v3ionic2-angularfire-sample>typings install --save --global dt~fire
base
firebase
└── (No dependencies)_
)
@shamrozwarraich add typings inside typings/index.d.ts like this
/// <reference path="../node_modules/angularfire2/firebase3.d.ts" />
Or you could try do the install method from #234
Here is the specific link
https://github.com/angular/angularfire2/issues/234#issuecomment-229560239
@imsingh the problem with including it there is that that file is autogenerated by typings and if you ever do another typings install (to add a new typings file or just refreshing them) it'll be removed automatically. I recommend you do not add the reference comment to the index.d.ts.
For example, the angular-cli sets up a postinstall script that automatically runs typings install after every 'npm install'. This can lead to very confusing errors because the typings you once had are now no longer included.
@filoxo as u mension in the #234 i followed the setup now i facing these error :/
ionic $ TypeScript error: E:/firebase v3/ionic2-angularfire-sample-firebase3-sup
port/node_modules/angularfire2/providers/auth.d.ts(12,20): Error TS1112: A class
member cannot be declared optional.
TypeScript error: E:/firebase v3/ionic2-angularfire-sample-firebase3-support/nod
e_modules/angularfire2/utils/firebase_object_observable.d.ts(6,17): Error TS1112
and thnks to all @davideast @jeffbcross @imsingh @dmastag
What's saved in your typings.json? I suspect that you might have both firebase and firebase3 typings saved. You should only have the latter.
"globalDependencies": {
"firebase3": "file:node_modules/angularfire2/firebase3.d.ts"
}
The only other thing I can think of is to delete typings/ directory in case some file there isn't being updated and then typings install to reinstall them.
new error :/ ....
Caught exception:
Error: ENOENT: no such file or directory, realpath 'E:\firebase v3\ionic2-angul
arfire-sample-firebase3-support\typings\main.d.ts'
at Error (native)
at Object.realpathSync (fs.js:1568:18)
at E:\firebase v3\ionic2-angularfire-sample-firebase3-support\node_modules\t
sify\index.js:58:38
at Array.map (native)
at DestroyableTransform.flush [as _flush] (E:\firebase v3\ionic2-angularfire
-sample-firebase3-support\node_modules\tsify\index.js:58:6)
at DestroyableTransform.<anonymous> (E:\firebase v3\ionic2-angularfire-sampl
e-firebase3-support\node_modules\through2\node_modules\readable-stream\lib\_stre
am_transform.js:115:49)
at DestroyableTransform.g (events.js:286:16)
at emitNone (events.js:86:13)
at DestroyableTransform.emit (events.js:185:7)
at prefinish (E:\firebase v3\ionic2-angularfire-sample-firebase3-support\nod
e_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:465:12)
@filoxo :-1: need help
Your error is referring to typings\main.d.ts
Caught exception:
Error: ENOENT: no such file or directory, realpath 'E:\firebase v3\ionic2-angul
arfire-sample-firebase3-support\typings\main.d.ts'
Assuming you're using typings version 1.x It should be typings\index.d.ts — make sure tsconfig.json is pointing to the correct file.
just make sure that
E:firebase v3ionic2-angularfire-sample-firebase3-supporttypingsmain.d.ts contains:
/// <reference path="globals/firebase3/index.d.ts" />
If you dont have the main.d.ts, then u can just copy index.d.ts and rename it
thnks to all @matstam @imsingh @r-park @imsingh @dmastag @filoxo
Closing because it looks like this was solved. @shamrozwarraich Respond if you still need help.
+1
ionic $ TypeScript error: E:/firebase v3/ionic2-angularfire-sample-firebase3-sup
port/node_modules/angularfire2/providers/auth.d.ts(12,20): Error TS1112: A class
member cannot be declared optional.
facing the above issue and the solutions didn't work for me.
added global firebase3. Now facing error as below
ERROR in [default] typings/browser/ambient/firebase/index.d.ts:328:1
Duplicate identifier 'export='.
ERROR in [default] typings/globals/firebase3/index.d.ts:406:2
Duplicate identifier 'export='
How to resolve.
@sourabhk0510 please create a new issue rather than responding to a closed one and follow the issue template (we can't help without sufficient info to verify and repro the problem)
Most helpful comment
@shamrozwarraich add typings inside typings/index.d.ts like this
/// <reference path="../node_modules/angularfire2/firebase3.d.ts" />