typescript: node_modules/angularfire2/app/firebase.app.module.d.ts, line: 12
Namespace ‘firebase’ has no exported member ‘Promise’.
this is weird because I was working on this project a few days ago and this error never popped up. Can somebody explain what’s happening or how to fix?
Edit: I forgot to mention that Ionic build and Ionic serve work completely fine.
Hi moscoso,
reason seems to be an update on the plugins. Made “cordova plugin update” and now I get the same error.
But got no solution so far.
best,
patrik
That’s what I expected you to say. Firebase has a longstanding issue with their type definitions lagging behind their SDKs. This has come up in the AngluarFire Github issues several times, even with Firebase 3. Also, frankly, I’m suspicious of RC2. My npm doesn’t install it unless I force it to, and there’s no official changelog from RC1 to RC2.
Unless you need Firebase 4, you might consider reverting to 3.9.x and AF RC0. Those are stable. The main breaking change from 3 to 4 is how user login info is reported. But that’s a single command, which you might not even use.
If the problem persists even after you revert, then maybe it’s a plugin problem, as the above user said. But I have a hard time seeing how Cordova intereferes with the Firebase namespace. Understand: I don’t know what’s going on, but I know it hasn’t happened to me, and I’m more cautious about Firebase versions than you are, so that’s my first guess about this source of the problem.
Well ok, your Node is out of date, and not an LTS. I’d fix that first. Either update to the LTS of track 6, or to 8.6. Both are fine.
In general, impose discipline on yourself to never manually edit package.json, ever. Allow npm to do all that work. This is even more important if you’re running npm 5, to ensure consistency between package.json and package.lock.json.
Specifically for this problem, I’d suggest you use npm to uninstall firebase and angularfire2, then rerun the official install command on the angularfire2 readme page. Allow npm to choose which version fits you, unless you have the expertise to push past that. (And it sounds as though you don’t yet, no offense.)
I found that reading the wikipedia pages on npm and NodeJS to be extremely helpful. It’s a bit of a time sink, because the content is dense, but it clarified a lot of things for me. I had been treating them like “just a command line.” Easy to do, I think, because that’s what it looks like. But there’s a lot more going on.
Hm well I just checked the angularfire2.read.me and all of my packages are up to date.
It even says I have the right version of node and npm
$ node -v
v6.10.2
$ npm -v
3.10.10
I just find it odd that I have no problem when I build and serve the ionic app locally. But for some reason it fails when pushing to ionic pro and the build in the cloud fails.