Build dev failed: Cannot read property 'indexOf' of undefined

I’m almost ripping my hair out with that mistake. Everything should be very simple but …
It seems that everything started to go wrong after including firebase and angualarfire2

Has anyone had this problem yet?

I tried this but it did not solve the problem;

I tried to help here too but I did not succeed

CONSOLE:
[23:36:47] ionic-app-scripts 0.0.46
[23:36:47] watch started …
[23:36:47] build dev started …
[23:36:47] clean started …
[23:36:47] clean finished in 3 ms
[23:36:47] copy started …
[23:36:47] transpile started …
[23:36:50] build dev failed: Cannot read property ‘indexOf’ of undefined
[23:36:50] copy: Error copying “D:\Apps\ … \src\assets” to
“D:\Apps\ … \www\assets”
[23:36:50] copy: Error copying “D:\Apps\ … \node_modules\ionicons\dist
fonts” to
“D:\Apps\ … \www\assets\fonts”
[23:36:50] copy: Error copying “D:\Apps\ … \node_modules\ionic-angular
fonts” to
“D:\Apps\ … \www\assets\fonts”
[23:36:50] copy finished in 3.02 s
[23:36:50] watch ready in 3.11 s
[23:36:50] dev server running: http://localhost:8100/

IONIC INFO:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.46
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.1
Xcode version: Not installed

package.json
{
“name”: “ionic-hello-world”,
“author”: “Ionic Framework”,
“homepage”: “http://ionicframework.com/”,
“private”: true,
“scripts”: {
“ionic:build”: “ionic-app-scripts build”,
“ionic:serve”: “ionic-app-scripts serve”
},
“dependencies”: {
@angular/common”: “2.1.1”,
@angular/compiler”: “2.1.1”,
@angular/compiler-cli”: “2.1.1”,
@angular/core”: “2.1.1”,
@angular/forms”: “2.1.1”,
@angular/http”: “2.1.1”,
@angular/platform-browser”: “2.1.1”,
@angular/platform-browser-dynamic”: “2.1.1”,
@angular/platform-server”: “2.1.1”,
@ionic/storage”: “1.1.6”,
“angularfire2”: “^2.0.0-beta.6”,
“firebase”: “^3.6.1”,
“ionic-angular”: “2.0.0-rc.3”,
“ionic-native”: “2.2.3”,
“ionicons”: “3.0.0”,
“rxjs”: “5.0.0-beta.12”,
“zone.js”: “0.6.26”
},
“devDependencies”: {
@ionic/app-scripts”: “0.0.46”,
@types/request”: “0.0.30”,
“typescript”: “^2.0.10”
},
“cordovaPlugins”: [
“cordova-plugin-whitelist”,
“cordova-plugin-console”,
“cordova-plugin-device”,
“ionic-plugin-keyboard”,
“cordova-plugin-statusbar”,
“cordova-plugin-splashscreen”
],
“cordovaPlatforms”: ,
“description”: “test: An Ionic project”
}

I am getting the exact same error !

I am also seeing this error on Windows only. Our Mac environments seem to be working fine.

Ionic team does not speak about it. Is it possible to fix this? Is there anything I can do? Do I need to format my pc? Do I have to buy a Mac?

Krapfl thanks for giving feedback on this. It seems to be a problem only in Windows environment.

Hi

Compare with:

Ionic 2.0.0-rc.3 & angularfire 2.0.0-beta.6 using side menu template

hth
Tim

I’m not sure what I am comparing. My project is having this issue and does not use angularfire.

Hey,

Try ionic serve --debug and copy/paste the errors.

D:\CgMobile>ionic serve --debug

Running 'serve:before' npm script before serve

> cgmobile2@0.1.0 watch D:\CgMobile
> ionic-app-scripts watch

[12:49:46]  ionic-app-scripts 0.0.46
[12:49:46]  watch started ...
[12:49:46]  build dev started ...
[12:49:46]  clean started ...
[12:49:46]  clean finished in 2 ms
[12:49:46]  copy started ...
[12:49:46]  transpile started ...
[12:49:59]  build dev failed: Cannot read property 'indexOf' of undefin
ed
[12:50:00]  copy: Error copying "D:\CgMobile\node_modules\ionicons\dist
\fonts" to "D:\CgMobile\www\assets\fonts"
[12:50:00]  copy: Error copying "D:\CgMobile\node_modules\ionic-angular
\fonts" to "D:\CgMobile\www\assets\fonts"
[12:50:00]  copy finished in 14.46 s
[12:50:00]  watch ready in 14.60 s

And then the Ionic Info:

    D:\CgMobile>ionic info

    Your system information:

    ordova CLI: 6.4.0
    Ionic Framework Version: 2.0.0-rc.3
    Ionic CLI Version: 2.1.13
    Ionic App Lib Version: 2.1.7
    Ionic App Scripts Version: 0.0.46
    ios-deploy version: Not installed
    ios-sim version: Not installed
    OS: Windows 10
    Node Version: v6.9.1
    Xcode version: Not installed

Same here: All of a sudden my project stopped building with the same error. I have rm -r node_modules and npm cache clean and then npm install. Same error. HELP anyone?

build dev failed: Cannot read property ‘indexOf’ of undefined MEM: 231.6MB
[ DEBUG! ] TypeError: Cannot read property ‘indexOf’ of undefined at loadDiagnostic
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:47:27) at
/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:12:16 at
Array.map (native) at Object.runTypeScriptDiagnostics
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/logger/logger-typescript.js:11:26) at
/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/transpile.js:92:47 at transpileWorker
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/transpile.js:62:12) at Object.transpile
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/transpile.js:26:12) at buildDev
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/build.js:84:24) at buildWorker
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/build.js:35:12) at Object.build
(/Users/emgould/Dev/testIonic/node_modules/@ionic/app-scripts/dist/build.js:19:12)

My System Info:

Your system information:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.45
ios-deploy version: 1.8.6
ios-sim version: 3.1.1
OS: OS X El Capitan
Node Version: v7.2.0
Xcode version: Xcode 7.3.1 Build version 7D1014

I was getting this error also, but not every time, which made it harder to chase. My “solution” was to use angularfire2 for auth.

ionic serve --debug:

ionic-app-scripts serve “–debug”

[22:11:32] ionic-app-scripts 0.0.46

[ DEBUG! ] An BuildUpdateStarted event occurred MEM: 117.5MB
[ DEBUG! ] An BuildUpdateCompleted event occurred MEM: 117.5MB
[ DEBUG! ] An FileChange event occurred MEM: 117.9MB
[ DEBUG! ] An ReloadApp event occurred MEM: 117.9MB

[22:11:32] watch started … MEM: 118.2MB
[22:11:32] build dev started … MEM: 118.2MB
[22:11:32] clean started … MEM: 118.2MB

[ DEBUG! ] clean D:\Apps\ ... \build MEM: 118.2MB

[22:11:32] clean finished in 3 ms MEM: 118.3MB
[22:11:32] copy started … MEM: 118.3MB
[22:11:32] transpile started … MEM: 118.5MB

[22:11:35] build dev failed: Cannot read property ‘indexOf’ of undefined MEM: 228.4MB

[ DEBUG! ] TypeError: Cannot read property ‘indexOf’ of undefined at loadDiagnostic
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\logger\logger-typescript.js:47:27) at
D:\Apps\ … \node_modules@ionic\app-scripts\dist\logger\logger-typescript.js:12:16 at
Array.map (native) at Object.runTypeScriptDiagnostics
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\logger\logger-typescript.js:11:26) at
D:\Apps\ … \node_modules@ionic\app-scripts\dist\transpile.js:98:47 at transpileWorker
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\transpile.js:68:12) at Object.transpile
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\transpile.js:26:12) at buildDev
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\build.js:86:24) at buildWorker
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\build.js:37:12) at Object.build
(D:\Apps\ … \node_modules@ionic\app-scripts\dist\build.js:21:12) MEM: 228.4MB

[ DEBUG! ] listening on 8100 MEM: 228.7MB

[22:11:36] copy: Error copying “D:\Apps\ … \src\assets” to “D:\Apps\ … \assets”
[22:11:36] copy: Error copying “D:\Apps\ … \node_modules\ionic-angular\fonts” to “D:\Apps\ … \assets\fonts”
[22:11:36] copy finished in 3.20 s MEM: 259.8MB

[ DEBUG! ] watcher ready: D:\Apps\ … D:\Apps\ … \src\assets,D:\Apps\ … \src\index.html,D:\Apps\ … \src\manifest.json,D:\Apps\ … \src\service-worker.js,node_modules\ionic-angular\polyfills\polyfills.js,node_modules\ionicons\dist\fonts,node_modules\ionic-angular\fonts
MEM: 230.1MB
[ DEBUG! ] watcher ready: D:\Apps\ ... D:\Apps\ ..... \src\**\*.(ts|html|scss) MEM: 230.1MB

[22:11:36] watch ready in 3.31 s MEM: 230.1MB
[22:11:36] dev server running: http://localhost:8100/

There is not enough info given by “ionic serve --debug”, Cannot read property ‘indexOf’ of undefined is always fired by Ionic when there is a crash on build.

Can you run “ionic build browser” and copy the log here ?

“browser” doesn’t matter, you can use android or any plateform you like

Ok. ionic build browser

[23:56:01] ionic-app-scripts 0.0.46
[23:56:01] build prod started …
[23:56:01] clean started …
[23:56:01] clean finished in 3 ms
[23:56:01] copy started …
[23:56:01] ngc started …
[23:56:01] copy: Error copying “D:\Apps\ … \src\assets” to “D:\Apps\ … \www\assets”
[23:56:01] copy: Error copying “D:\Apps\ … \node_modules\ionic-angular\fonts” to “D:\Apps\ … \www\assets\fonts”
[23:56:01] copy finished in 403 ms

[23:56:17] Error: Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:12:9
[23:56:17] Duplicate identifier ‘Promise’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:17:9
[23:56:17] Duplicate identifier ‘Promise_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:130:9
[23:56:17] Duplicate identifier ‘EmailAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:135:9
[23:56:17] Duplicate identifier ‘EmailAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:144:9
[23:56:17] Duplicate identifier ‘FacebookAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:148:9
[23:56:17] Duplicate identifier ‘FacebookAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:153:9
[23:56:17] Duplicate identifier ‘GithubAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:157:9
[23:56:17] Duplicate identifier ‘GithubAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:162:9
[23:56:17] Duplicate identifier ‘GoogleAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:167:9
[23:56:17] Duplicate identifier ‘GoogleAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:172:9
[23:56:17] Duplicate identifier ‘TwitterAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:177:9
[23:56:17] Duplicate identifier ‘TwitterAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:181:8
[23:56:17] Duplicate identifier ‘UserCredential’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:339:8
[23:56:17] Duplicate identifier ‘StringFormat’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:340:7
[23:56:17] Duplicate identifier ‘StringFormat’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:347:8
[23:56:17] Duplicate identifier ‘TaskEvent’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:348:7
[23:56:17] Duplicate identifier ‘TaskEvent’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:352:8
[23:56:17] Duplicate identifier ‘TaskState’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:353:7
[23:56:17] Duplicate identifier ‘TaskState’.
[23:56:17] Error at D:/Apps/ …/node_modules/angularfire2/node_modules/firebase/firebase.d.ts:390:3
[23:56:17] Duplicate identifier ‘export=’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:12:9
[23:56:17] Duplicate identifier ‘Promise’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:17:9
[23:56:17] Duplicate identifier ‘Promise_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:132:9
[23:56:17] Duplicate identifier ‘EmailAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:137:9
[23:56:17] Duplicate identifier ‘EmailAuthProvider_Instance’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:146:9
[23:56:17] Duplicate identifier ‘FacebookAuthProvider’.
[23:56:17] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:150:9
[23:56:17] Duplicate identifier ‘FacebookAuthProvider_Instance’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:156:9
[23:56:18] Duplicate identifier ‘GithubAuthProvider’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:160:9
[23:56:18] Duplicate identifier ‘GithubAuthProvider_Instance’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:166:9
[23:56:18] Duplicate identifier ‘GoogleAuthProvider’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:171:9
[23:56:18] Duplicate identifier ‘GoogleAuthProvider_Instance’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:177:9
[23:56:18] Duplicate identifier ‘TwitterAuthProvider’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:182:9
[23:56:18] Duplicate identifier ‘TwitterAuthProvider_Instance’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:187:8
[23:56:18] Duplicate identifier ‘UserCredential’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:358:8
[23:56:18] Duplicate identifier ‘StringFormat’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:359:7
[23:56:18] Duplicate identifier ‘StringFormat’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:366:8
[23:56:18] Duplicate identifier ‘TaskEvent’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:367:7
[23:56:18] Duplicate identifier ‘TaskEvent’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:371:8
[23:56:18] Duplicate identifier ‘TaskState’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:372:7
[23:56:18] Duplicate identifier ‘TaskState’.
[23:56:18] Error at D:/Apps/ …/node_modules/firebase/firebase.d.ts:409:3
[23:56:18] Duplicate identifier ‘export=’.
[23:56:18] ngc failed
[23:56:18] ionic-app-script task: “build”
[23:56:18] Error: Error

npm ERR! Windows_NT 10.0.14393
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “run” “ionic:build” "–"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ ionic:build: ionic-app-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-hello-world@ ionic:build script ‘ionic-app-scripts build’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-hello-world
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls ionic-hello-world
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\Apps\ … \npm-debug.log

Look a those 2 errors

[23:56:17] Error: Error at D:/Apps/ .../node_modules/angularfire2/node_modules/firebase/firebase.d.ts:12:9
[23:56:17] Duplicate identifier 'Promise'.

[23:56:17] Error at D:/Apps/ .../node_modules/firebase/firebase.d.ts:12:9
[23:56:17] Duplicate identifier 'Promise'.

It’s because, as you can see, angularfire2 has the depdency “firebase”, and you installed “firebase” as a module too, as I presume ? If it’s not the case, it’s angularfire2’s fault.

But the typescript compiler cry "HEY THERE IS TWICE THE SAME CODE !! WHICH ONE I TAKE ?"
See this topic on stackoverflow “Typescript, confusing “duplicate identifier” error message

Since I think that you mainly want to use angularFire2 and not vanilla firebase, one solution is to run “npm uninstall firebase --save”.

But one weird thing is that “angularFire2” has its own node_module folder… can someone explain it to me?

You should report this error on the angulare fire 2 github, it would help the community.

Okay. Thank you so much for your time trying to help me.

No problem, Did it work ?

Shocoben, you’re my hero.

Good question. Why does angularfire2 install a firebase folder inside your node_module?

The question:
To use p firebase service (I never understood this either) we must install in that order:
Npm install firebase angularfire2 --save

After Shocoben opened my eye: firebase is doubled.
1 - within node_module
1 - within angularfire2 / node_module

Solution:

In node_module / angularfire2 / node_module / => delete the firebase folder.

WORKED FOR ME - Thank you very much Shocoben

That’s all fine and good for those errors, but again, I am not using FireBase (or angularfire2) in my project… So what is the deal then?

Here is my output from a serve --debug:

D:\CgMobile>ionic serve

Running 'serve:before' npm script before serve

> cgmobile2@0.1.0 watch D:\CgMobile
> ionic-app-scripts watch --debug

[07:23:48]  ionic-app-scripts 0.0.46
[07:23:48]  watch started ... MEM: 86.0MB
[07:23:48]  build dev started ... MEM: 86.0MB
[07:23:48]  clean started ... MEM: 86.0MB
[ DEBUG! ]  clean D:\CgMobile\www\build  MEM: 86.1MB
[07:23:48]  clean finished in 1 ms MEM: 86.1MB
[07:23:48]  copy started ... MEM: 86.1MB
[07:23:48]  transpile started ... MEM: 86.3MB
[07:23:56]  build dev failed: Cannot read property 'indexOf' of undefined  MEM: 298.5MB
[ DEBUG! ]  TypeError: Cannot read property 'indexOf' of undefined at loadDiagnostic
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\logger\logger-typescript.js:47:27) at
            D:\CgMobile\node_modules\@ionic\app-scripts\dist\logger\logger-typescript.js:12:16 at Array.map (native) at
            Object.runTypeScriptDiagnostics
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\logger\logger-typescript.js:11:26) at
            D:\CgMobile\node_modules\@ionic\app-scripts\dist\transpile.js:98:47 at transpileWorker
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\transpile.js:68:12) at Object.transpile
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\transpile.js:26:12) at buildDev
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\build.js:86:24) at buildWorker
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\build.js:37:12) at Object.build
            (D:\CgMobile\node_modules\@ionic\app-scripts\dist\build.js:21:12)  MEM: 298.5MB
[07:23:57]  copy: Error copying "D:\CgMobile\node_modules\ionicons\dist\fonts" to "D:\CgMobile\www\assets\fonts"
[07:23:57]  copy finished in 9.21 s MEM: 329.5MB
[ DEBUG! ]  watcher ready:
                D:\CgMobileD:\CgMobile\src\assets\,D:\CgMobile\src\index.html,D:\CgMobile\src\manifest.json,D:\CgMobile\src\service-worker.js,node_modules\ionic-angular\polyfills\polyfills.js,nod
e_modules\ionicons\dist\fonts\,node_modules\ionic-angular\fonts\
            MEM: 303.9MB
[ DEBUG! ]  watcher ready: D:\CgMobileD:\CgMobile\src\**\*.(ts|html|scss)  MEM: 303.9MB
[07:23:57]  watch ready in 9.36 s MEM: 303.9MB

@nilton_felicio I think your solution might have unintended consequences, and it wasn’t what @Shocoben suggested. I agree that posting on GitHub would be a good idea, because angularfire2 is still changing a lot.

The biggest issue for me was to handle both auth and upload/download, when angularfire2 can’t do upload/download yet. I dealt with this by following the angularfire2 docs for auth, and by using @Inject(FirebaseApp) firebaseApp: firebase.app.App when I wanted to upload or download. This gave me a typed object I could use instead of running into duplicate call problems from using firebase – for example var gsReference = firebaseApp.storage().refFromURL('gs://firebasestoragefolder/images/imagename.jpg');

See the second code snippet at this SO answer for a more complete example.

I don’t know whether that will eventually break, but I expect there will be a better way to do things after angularfire2 wraps Firebase storage functions.

Something new?