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

For me it works perfectly. Follow the steps and be sure to update the app-script to 0.48.

npm install firebase angularfire2 --save = > NO
npm install angularfire2 --save => YES.
Do not install firebase. Only install AngularFire2, not documented but Firebase is inside AngularFire2. Also when using firebase, you no longer need:
import firebase from firebase ->Do not do it.

My project goes this way without making any mistakes on the console. I hope I have helped.

Hello, I had your problem this morning and I didn’t know what to do.

I figured out I was using the library @types/es6-shim to get some typings for Promises and other es6 stuff in other libraries of my own that I later imported to my project. When I imported these libraries I developed to my project I started getting the error.

Then I saw I had installed typescript as a dependency and I saw it uses the library lib.es2015.d.ts which conflicts with @types/es6-shim. I discovered this by building to android. When I did this I got a lot of errors in the console telling me there were duplicates in some typings.

The way I fixed it was removing @types/es6-shim from my node_modules folder and then removing the triple slash references from my modules (so they would use lib.es2015 and not @types/es6-shim.

I hope this helps

Exactly the same problem here (we have no firebase or angularfire2 installed on the project but it fails with that “‘indexOf’ of undefined” error).
Did you finally fix it up?

Which version of app-scripts do you have?
Had the same error without Angularfire2 on a old version of the appscript.
Another post about it

I had 0.0.47 but after changing it to 1.0.0 it seems to work Ok.
Thanks!

np dude :slight_smile: