Errors in Blank template for Ionic 2

Hi,
Im new here. Sorry if Im in the wrong category.

With the new blank template for Ionic 2, Im getting thise errors in my Chrome browser.
Any fix for that?

Thanks!

Errors:

5 messages are hidden by filters.
.
(index):54 Refused to execute inline script because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-gpnLwpFw97DB28/JjA3G79AHgq5DtCgFiFwjahrA1d4='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
app.bundle.js:48516 EXCEPTION: TypeError: Cannot read property 'setStyle' of undefined
app.bundle.js:48507 EXCEPTION: TypeError: Cannot read property 'setStyle' of undefined
app.bundle.js:48507 STACKTRACE:
app.bundle.js:48507 TypeError: Cannot read property 'setStyle' of undefined
at http://localhost:8100/build/js/app.bundle.js:9434: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:40110: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:40168:26)
at arguments.(anonymous function) (http://localhost:8100/build/js/app.bundle.js:8873:25)

Thanks for letting us know! I created an issue for it and we will look into it:

https://github.com/driftyco/ionic2/issues/637

1 Like

The issue has been fixed in the blank starter, but if you don’t want to make a new one you can remove this line from app.js:

StatusBar.setStyle(StatusBar.DEFAULT);
1 Like

It works - thanks :slight_smile:

1 Like

I was running into similar issues with the blank template, the StatusBar was one problem but I think you will also need to import the .scss file in app.js otherwise SASS won’t work correctly:

import './app.scss';

1 Like