Starting a new project using Ionic 2 and encountering an error after installing angular2-jwt:
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
D:\desenv\arquivos\workspace_inbit\medipop-parent\medipop-app\node_modules\angular2-jwt\angular2-jwt.ts:1
import {Injectable, Injector} from 'angular2/core';
To reproduce the issue:
ionic start testapp --v2 --ts
cd testapp
npm i --save angular2-jwt
Here is the code snippet causing the error:
@App({
templateUrl: 'build/app.html',
providers: [
provide(AuthHttp, {
useFactory: (http) => {
return new AuthHttp(new AuthConfig({
headerPrefix: '',
noJwtError: true
}), http);
},
deps: [Http]
})
]
})
class MyApp {}
Seeking help to solve this puzzle. Any suggestions?