Skip to content

firebase3. ionic 2 error #307

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shamrozwarraich opened this issue Jun 30, 2016 · 16 comments
Closed

firebase3. ionic 2 error #307

shamrozwarraich opened this issue Jun 30, 2016 · 16 comments

Comments

@shamrozwarraich
Copy link

shamrozwarraich commented Jun 30, 2016

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 v3\ionic2-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 v3\ionic2-angularfire-sample>typings install --save --ambient firebase
typings ERR! deprecated The "ambient" flag is deprecated. Please use "global" in
stead

E:\firebase v3\ionic2-angularfire-sample>typings install --save --global dt~fire
base
firebase
└── (No dependencies)_
)

@imsingh
Copy link

imsingh commented Jul 1, 2016

@shamrozwarraich add typings inside typings/index.d.ts like this
/// <reference path="../node_modules/angularfire2/firebase3.d.ts" />

@dmastag
Copy link
Contributor

dmastag commented Jul 1, 2016

Or you could try do the install method from #234

Here is the specific link
#234 (comment)

@filoxo
Copy link
Contributor

filoxo commented Jul 1, 2016

@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.

@shamrozwarraich
Copy link
Author

shamrozwarraich commented Jul 1, 2016

@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

@filoxo
Copy link
Contributor

filoxo commented Jul 1, 2016

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.

@shamrozwarraich
Copy link
Author

"globalDependencies": {
"firebase3": "file:node_modules/angularfire2/firebase3.d.ts"
}

@filoxo
Copy link
Contributor

filoxo commented Jul 1, 2016

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.

@shamrozwarraich
Copy link
Author

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)



@shamrozwarraich
Copy link
Author

@filoxo 👎 need help

@r-park
Copy link

r-park commented Jul 4, 2016

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.

@matstam
Copy link

matstam commented Jul 4, 2016

just make sure that
E:\firebase v3\ionic2-angularfire-sample-firebase3-support\typings\main.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

@shamrozwarraich
Copy link
Author

thnks to all @matstam @imsingh @r-park @imsingh @dmastag @filoxo

@davideast
Copy link
Collaborator

Closing because it looks like this was solved. @shamrozwarraich Respond if you still need help.

@AhsanAyaz
Copy link

+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.

@sourabhk0510
Copy link

sourabhk0510 commented Nov 3, 2016

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.

@katowulf
Copy link
Contributor

katowulf commented Nov 3, 2016

@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)

@angular angular locked and limited conversation to collaborators Nov 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants