プロジェクトのイオン2プロジェクトの外にある自分のタイスクリプトファイルの使用に問題があります。私は使用したい認証モジュールを持っていて、うまく動作しません。私はそれがtypescriptの設定やイオンの問題であるかどうかは分かりません。Ionic 2/Typescriptビルドに失敗しました:予期しない文字 '@'
app.module.ts
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": true,
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["dom", "es2015"]
},
"exclude": ["node_modules"],
"compileOnSave": false,
"atom": { "rewriteTsconfig": false }
}
auth.module.ts
import {NgModule} from "@angular/core";
import {HttpModule} from "@angular/http";
import {IdentityService} from "./identity.service";
import {IdentityEventService} from "./identity-event.service";
@NgModule({
imports: [HttpModule],
providers: [
IdentityService,
IdentityEventService
]
})
export class AuthModule {
}
tsconfig.json
import { NgModule } from '@angular/core';
import {IonicApp, IonicModule} from 'ionic-angular';
import { MyApp } from './app.component';
import { LoginComponent } from './login/login.component';
import {AuthModule} from "../../../web/src/shared/services/auth/auth.module";
@NgModule({
declarations: [
MyApp,
LoginComponent
],
imports: [
IonicModule.forRoot(MyApp),
AuthModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
LoginComponent
],
providers: [
]
})
export class AppModule {}
私はFを取得しますエラー:
[14:34:24]バンドルに失敗しました..../web/src/shared/services/auth/auth.module.tsの予期しない文字 '@'(5:0)
したがって、パッケージを検索しているように見えますが、NgModule宣言では窒息します。 auth.module
への参照を削除すると動作します。 authモジュールが私のionicプロジェクトのpackage.jsonファイルに必要とするすべてのパッケージを追加しましたので、参照は問題ではありません。
これをデバッグするのに必要な関連情報がある場合はお知らせください。
私は同じ問題があります。 "ionic serve"が動作し、 "ionic build"がこの予期しない文字例外で失敗する – Chris
どちらも失敗する:( – sgcharlie