2017-11-10 1 views
1

이온 및 이온 각도의 최신 모듈로 업그레이드 한 후이 오류가 발생합니다. 다음은이 문제가 발생모듈 구문 분석 실패 : 예기치 않은 토큰 ionic 3

enter image description here

런타임 오류 사람들을 위해

Module parse failed: Unexpected token (84:1254) You may need an appropriate loader to handle this file type. | HomelistPage = __decorate([ | Component({ | selector: 'page-homelist',template:/*ion-inline-start:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/`<ion-header>\n <ion-navbar color="bluegray">\n <button ion-button menuToggle color="light">\n <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title color="light">Instractors</ion-title>\n <ion-buttons right>\n <button color="light" ion-button icon-only (click)="createMessage()">\n <ion-icon name="more"></ion-icon>\n </button>\n </ion-buttons>\n </ion-navbar>\n <ion-toolbar color="bluegray">\n <ion-searchbar></ion-searchbar>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <!--*********** 2 colomns list ***********-->\n <ion-grid>\n <ion-row wrap>\n <ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">\n <ion-card class="cardList">\n <div *ngIf="item.discount" class="ribbon pop-in">SALE</div>\n <img class="pop-in" src={{item.imgSmall}} />\n <ion-card-header>\n {{item.name}}\n </ion-card-header>\n <ion-card-content>\n <p *ngIf="!item.discount" ion-text color="special-blue">\n <strong>${{item.price}}</strong>\n </p>\n <p *ngIf="item.discount" ion-text color="special-blue" class="discount">${{item.price}}</p>\n <p *ngIf="item.discount" ion-text large color="red">\n <strong>${{item.discountPrice}}</strong>\n </p>\n </ion-card-content>\n </ion-card>\n </ion-col>\n </ion-row>\n </ion-grid>\n</ion-content>`/*ion-inline-end:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/, | }), | __metadata("design:paramtypes", [NavController, NavParams, ToastController, 


Error: Module parse failed: Unexpected token (84:1254) 
You may need an appropriate loader to handle this file type. 
|  HomelistPage = __decorate([ 
|   Component({ 
|    selector: 'page-homelist',template:/*ion-inline-start:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/`<ion-header>\n <ion-navbar color="bluegray">\n <button ion-button menuToggle color="light">\n  <ion-icon name="menu"></ion-icon>\n </button>\n <ion-title color="light">Instractors</ion-title>\n  <ion-buttons right>\n   <button color="light" ion-button icon-only (click)="createMessage()">\n   <ion-icon name="more"></ion-icon>\n   </button>\n  </ion-buttons>\n </ion-navbar>\n <ion-toolbar color="bluegray">\n <ion-searchbar></ion-searchbar>\n </ion-toolbar>\n</ion-header>\n\n<ion-content>\n <!--*********** 2 colomns list ***********-->\n <ion-grid>\n <ion-row wrap>\n  <ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">\n  <ion-card class="cardList">\n   <div *ngIf="item.discount" class="ribbon pop-in">SALE</div>\n   <img class="pop-in" src={{item.imgSmall}} />\n   <ion-card-header>\n   {{item.name}}\n   </ion-card-header>\n   <ion-card-content>\n   <p *ngIf="!item.discount" ion-text color="special-blue">\n    <strong>${{item.price}}</strong>\n   </p>\n   <p *ngIf="item.discount" ion-text color="special-blue" class="discount">${{item.price}}</p>\n   <p *ngIf="item.discount" ion-text large color="red">\n    <strong>${{item.discountPrice}}</strong>\n   </p>\n   </ion-card-content>\n  </ion-card>\n  </ion-col>\n </ion-row>\n </ion-grid>\n</ion-content>`/*ion-inline-end:"/Users/macbook/Downloads/studio/src/pages/home/homelist/homelist.html"*/, 
|   }), 
|   __metadata("design:paramtypes", [NavController, NavParams, ToastController, 
    at Object.448 (http://localhost:8100/build/main.js:1042:7) 
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30) 
    at Object.254 (http://localhost:8100/build/main.js:335:68) 
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30) 
    at Object.331 (http://localhost:8100/build/main.js:556:96) 
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30) 
    at Object.309 (http://localhost:8100/build/main.js:531:70) 
    at __webpack_require__ (http://localhost:8100/build/vendor.js:55:30) 
    at webpackJsonpCallback (http://localhost:8100/build/vendor.js:26:23) 
    at http://localhost:8100/build/main.js:1:1 
+0

질문에 package.json을 포함 할 수 있습니까? –

+0

@SurajRao가 업데이트되었습니다. –

+0

공개 문제가 있습니다 https://github.com/ionic-team/ionic/issues/13379 –

답변

4

.. 여기

업그레이드 후 내 Package.json 파일입니다 .. 업그레이드 한 후 내 Package.json 파일입니다 @ionic/app-scripts : 3.1.0으로 업그레이드 한 후 수정하려면 node_modules/@ionic/app-scripts/dist/template.js:153으로 이동하고 코드 줄을

으로 바꿉니다.

return getTemplatePrefix(htmlFilePath) + "'" + content + "'" + getTemplateSuffix(htmlFilePath);

이것은 버그에 대한 수동 수정 이었지만 릴리스되었습니다. @ionic/app-scripts : 3.1.1 버그가 수정되었습니다.

0

Gerald Brigen과 Suraj Rao의 조언을 읽은 후, 나는 https://github.com/ionic-team/ionic/issues/13379을 보았습니다.

package.json app-scripts를 3.1.0에서 3.1.1로 업데이트했습니다. 해당 모듈을 제거하고 npm -i를 실행했습니다.

"devDependencies": { 
     "@ionic/app-scripts": "3.1.1", 
} 
관련 문제