Angular:
4.2.4
Firebase:
4.5.0
AngularFire:
4.0.0-rc0
Other (e.g. Ionic/Cordova, Node, browser, operating system):
Node v6.11.3, Windows 7 x64
import { Component } from '@angular/core';
import { AngularFireDatabase, FirebaseListObservable } from 'angularfire2/database';
interface MovieQuote {
movie: string;
quote: string;
$key?: string;
}
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
formMovieQuote: MovieQuote = {
'movie': '',
'quote': ''
};
movieQuotesStream: FirebaseListObservable<MovieQuote[]>;
constructor(db: AngularFireDatabase) {
this.movieQuotesStream = db.list('/quotes');
}
onSubmit() {
this.formMovieQuote = {
'movie': '',
'quote': ''
};
}
}
@yazan-alomari Update to the 5.0 branch to fix this error. This also upgrades you to the new database API. The migration is easy and the guide is here. However, if you need to stay on the old version use the angularfire2/database-deprecated module.
Still getting the "no exported member 'Promise'" error.
@EstiShay What version of Firebase, Angular, and AngularFire are you on? And can you print the exact error?
firebase.Promise was removed in Firebase 4.5.0. AngularFire 5.0 accounts for this change. You're likely still on the old AngularFire package.
angularfire: 5.0.0-rc.0-next
firebase: 4.2.0-4.5.0
angular: 4.2.4
We're still getting it. Tried to roll back to pre-Firebase 4.5.0 and use AngularFire 4.0.0-rc.0. This way we get a screen full of Promise errors. When we update to 5.0, we still get one Promise error.
ERROR in /Users/Guest/Desktop/.../node_modules/angularfire2/firebase.app.module.d.ts (12,28): Namespace 'firebase' has no exported member 'Promise'.
Is there a documentation for updating the previous code in accordance with AngularFire 5.0?
I have tried the changes mentioned here.Still I'm unable to resolve the issue.
@davideast I think you should be waited for a little before closing the ticket!
Why I have to do full refactor for just a little modification?
This is fixed in master
https://github.com/angular/angularfire2/commit/96b3c208064b1019399e892e58ee480b4264eeb9#diff-bdb6b409af08da485e2b960e4d9f75eaL16
Hi,
i have the same problem here, and i don't want to make changes on my code, because in this case i should make a lot of changes
how can i downgrade firebase and angularfire to resolve this issue ?
Hi,
I had a look at the commit that @Maistho mentions above. But when I look at that file in my local node_modules, the changes are not there. So, I checked the version of angularfire2 in my local node_modules: it's 5.0.0-rc.0-next.
In my project, my package.json specifies "angularfire2": "^5.0.0-rc.3"
When I run yarn add angularfire2 5.0.0-rc3 I get error Couldn't find package "5.0.0-rc.3" on the "npm" registry.
When I delete node_modules and run npm install I can see "version": "5.0.0-rc.3" in my local node_modules. And I don't get the firebase has no exported member 'Promise error. The specific error message for that error is:
ERROR in /home/circleci/repo/node_modules/angularfire2/firebase.app.module.d.ts (12,28): Namespace 'firebase' has no exported member 'Promise'.
I'm not sure why there is a difference between yarn and npm, but I hope this helps
Charlie
@CharlesSuttie
yarn add angularfire2 5.0.0-rc3 should be yarn add [email protected] instead.
If you have rc.0-next you will get the error. rc.2 and above should be fine.
when update
the version of angularfire2 in my local node_modules: it's 5.0.0-rc.0-next.
then getting this error :
node_modules/angularfire2/database/index"' has no exported member 'FirebaseListObservable'
I don't want to upgrade to v5. How does one stay on 4.0.0-rc.0 (or 1,2)? Is there an actual working v4 anymore?
I don't want to upgrade to v5. How does one stay on 4.0.0-rc.0 (or 1,2)? Is there an actual working v4
anymore?
im having the same problem...
Same problem.."angularfire2": "^5.0.0-rc.3" and "firebase": "^4.6.0"...that's using npm install firebase@latest so don't know how you're getting firebase V5.
Error is:
Namespace 'firebase' has no exported member 'Promise'.
I'm having the same problem.
angular: 4.1.3
angularfire2: 5.0.0-rc.3
firebase: 4.6.0
Node: v6.10.0
npm: 4.2.0
OS: macOS Sierra
Xcode: Xcode 9.0.1 Build version 9A1004
Found some answers...Firebase doesn't have a promise any more...it is just a generic promise so change firebase.promise
Also Angularfire2 doesn't have a submit on the object any more...read the conversions from 4 to 5...you have to do some mapping to get it to behave in a similar fashion.... beware breaking updates!!!
I rolled back to [email protected] and worked just fine. @davideast the "angularfire2/database-deprecated" didn't work out for me I don't know if there's a specific version that has that module integrated.
@tinomen any solution?
@mubasshir
"angularfire2": "^5.0.0-rc.3",
"firebase": "4.4.0",
Should work
Yeah, rollback from V5 if you don't want the breaking changes or look at the blogs from Jorg at javebratt.com to work out how to use the new features...he's been updating his blogs to cover V5
@mubasshir I downgraded and it is working fine.
"angularfire2": "4.0.0-rc.0",
"firebase": "^3.6.6",
I'm too close to completion that I don't want to spend anytime upgrading to v5. Unfortunately, it is generally allowed to introduce breaking changes in rc versions but it's too bad there wasn't much explanation until folks started logging issues. It's the unfortunate side of open source when a major version has this experience then abandoned.
@tinomen, you can upgrade to V5 and keep the old API. Just switch your database imports to angularfire2/database-deprecated.
but it's too bad there wasn't much explanation until folks started logging issues
I'm sorry that you felt frustration and a bit of surprise with the new version. I tried hard to solicit feedback and create awareness of the upcoming changes. There was a long detailed proposal to the breaking changes that was created three weeks before the 5.0 release. We created a migration guide upon releasing the new version. I want to avoid these frustrating experiences in the future. What else could we do to make this process easier?
I get this error but its coming from node_module.
my package.json says "angularfire2": "^5.0.0-rc.3",
i did npm update/install and deleted node_modules folder and re-installed..but i keep getting this file with Promise in it.
/node_modules/angularfire2/firebase.app.module.d.ts (12,28): Namespace 'firebase' has no exported member 'Promise'.
angularfire2/database-deprecated does not help me. any idea?
I've got "angularfire2": "^5.0.0-rc.3" too, and can't get the right declaration for delete, so...
I'm just manually editing firebase.app.module.d.ts and manually changing:
delete: () => firebase.Promise<any>;
to
delete: () => Promise<any>;
Terrible, but I'm doing this just to get back to work until this issue is resolved.
@davideast I was speaking of the v4 changes. I got the error when npm installed rc.1. 4-rc0 with firebase 3.6.6 doesn't throw the error and I can just move on with dev. When my POC is done I'll evaluate an upgrade to v5
@NimaiMalle - I know it's less than ideal, but this is an instance where learning to use some of the great GNU tools like find, sed, and grep in a terminal can make your life a little easier. https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files
@NimaiMalle changing from firebase.Promise to Promise is not an issue, actually, I like this, it does not make sense to have many types of the same Promise object! it is confusing also is making unnecessary wrapping and more code just to switch from Promise to firebase.Promise and the way back, this was a headache, it is indeed a good change, especially they were the same and there was nothing special about firebase.Promise anyway.
@tnesbit450 it is not only a "string" to replace! it is a class need to be imported as well! it is not that easy as what you are thinking, it is simply a refactor that you need to do.
Having "angularfire2": "^5.0.0-rc.3" in my package.json seemed to make yarn install 5.0.0-rc.0-next.
But after checking npm semver calculator, I found that changing the entry in package.json to "angularfire2": "5.0.0-rc.3" (i.e without the carat) causes yarn to install 5.0.0-rc.3 instead of 5.0.0-rc.0-next. This fixed the problem for me.
@almothafar - yeah, Always easier said ham done of course. But, files are nothing but strings. With the exception of binaries, it鈥檚 pretty straight forward. And even that can be accounted for. It doesn鈥檛 hurt to give it a shot. One simple command in the CLI. And if you can鈥檛 make it work, you just roll back the changes in one more simple line of text in a CLI.
What I'm seeing is: Namespace 'firebase' has no exported member 'firestore' in the following .d.ts files:
node_modules/angularfire2/firebase.app.module.d.ts
node_modules/angularfire2/firestore/collection/changes.d.ts
node_modules/angularfire2/firestore/firestore.d.ts
node_modules/angularfire2/firestore/interfaces.d.ts
node_modules/angularfire2/firestore/observable/fromRef.d.ts
I'm on "angularfire2": "^5.0.0-rc.3".
Is there a documentation for v5? Old namespace don't work anymore.
I have to do rollback to
"angularfire2": "4.0.0-rc.0",
"firebase": "^3.6.6",
and works for me
here, the steps to migrate to V5.
StepsToupdateV5
Most helpful comment
angularfire: 5.0.0-rc.0-next
firebase: 4.2.0-4.5.0
angular: 4.2.4
We're still getting it. Tried to roll back to pre-Firebase 4.5.0 and use AngularFire 4.0.0-rc.0. This way we get a screen full of Promise errors. When we update to 5.0, we still get one Promise error.
ERROR in /Users/Guest/Desktop/.../node_modules/angularfire2/firebase.app.module.d.ts (12,28): Namespace 'firebase' has no exported member 'Promise'.