Cannot read property 'setStyle' of undefined

This is a strange error that I am getting when my application starts. It does not seem to hurt anything so far, but it is just annoying.

Anybody had that issue and have a solution? I am running version 34.

Here what Chrome is giving me:

EXCEPTION: TypeError: Cannot read property ‘setStyle’ of undefined
BrowserDomAdapter.logError @ app.bundle.js:48515
BrowserDomAdapter.logGroup @ app.bundle.js:48525
ExceptionHandler.call @ app.bundle.js:26319
(anonymous function) @ app.bundle.js:49597
NgZone._notifyOnError @ app.bundle.js:4020
5errorHandling.onError @ app.bundle.js:40103
run @ app.bundle.js:8376
(anonymous function) @ app.bundle.js:40118
zoneBoundFn @ app.bundle.js:8346
promiseReactionJob @ app.bundle.js:1930
(anonymous function) @ app.bundle.js:2215
Item.run @ app.bundle.js:3434
drainQueue @ app.bundle.js:3404
cb @ app.bundle.js:40176
arguments.(anonymous function) @ app.bundle.js:8873
(anonymous function) @ app.bundle.js:8353
run @ app.bundle.js:8373
(anonymous function) @ app.bundle.js:40118
zoneBoundFn @ app.bundle.js:8346
app.bundle.js:48515

STACKTRACE:
BrowserDomAdapter.logError @ app.bundle.js:48515
ExceptionHandler.call @ app.bundle.js:26321
(anonymous function) @ app.bundle.js:49597
NgZone._notifyOnError @ app.bundle.js:40205
errorHandling.onError @ app.bundle.js:40103
run @ app.bundle.js:8376
(anonymous function) @ app.bundle.js:40118
zoneBoundFn @ app.bundle.js:8346
promiseReactionJob @ app.bundle.js:1930
(anonymous function) @ app.bundle.js:2215
Item.run @ app.bundle.js:3434
drainQueue @ app.bundle.js:3404
cb @ app.bundle.js:40176
arguments.(anonymous function) @ app.bundle.js:8873
(anonymous function) @ app.bundle.js:8353
run @ app.bundle.js:8373
(anonymous function) @ app.bundle.js:40118
zoneBoundFn @ app.bundle.js:8346
app.bundle.js:48515

TypeError: Cannot read property ‘setStyle’ of undefined
at http://localhost:8100/build/js/app.bundle.js:9440:31
at Zone.run (http://localhost:8100/build/js/app.bundle.js:8373:18)
at Zone.run (http://localhost:8100/build/js/app.bundle.js:40118:43)
at zoneBoundFn (http://localhost:8100/build/js/app.bundle.js:8346:20)
at promiseReactionJob (http://localhost:8100/build/js/app.bundle.js:1930:28)
at http://localhost:8100/build/js/app.bundle.js:2215:14
at Item.run (http://localhost:8100/build/js/app.bundle.js:3434:15)
at drainQueue (http://localhost:8100/build/js/app.bundle.js:3404:43)
at cb (http://localhost:8100/build/js/app.bundle.js:40176:26)
at arguments.(anonymous function) (http://localhost:8100/build/js/app.bundle.js:8873:25)

Found my issue!

In my “inittializeApp()” function, in app.js, I had:

initializeApp() {
  this.platform.ready().then(() => {
    console.log('Platform ready');
    StatusBar.setStyle(StatusBar.DEFAULT);
});

}

By commenting “StatusBar” line, the warning disappeared!

Might you don’t have the StatuBar Plugin 。

I probably did a copy paste and did not notice that cordova plugin was installed on that specific project. Thanks!