Module parse failed: Unexpected token ionic 3(模块解析失败:意外的令牌离子 3)
问题描述
After upgrading to the latest module of ionic and ionic-angular am getting this error. Here is my Package.json file after upgrading..
Here is my Package.json file after upgrading..
Runtime 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>
<ion-navbar color="bluegray">
<button ion-button menuToggle color="light">
<ion-icon name="menu"></ion-icon>
</button>
<ion-title color="light">Instractors</ion-title>
<ion-buttons right>
<button color="light" ion-button icon-only (click)="createMessage()">
<ion-icon name="more"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
<ion-toolbar color="bluegray">
<ion-searchbar></ion-searchbar>
</ion-toolbar>
</ion-header>
<ion-content>
<!--*********** 2 colomns list ***********-->
<ion-grid>
<ion-row wrap>
<ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">
<ion-card class="cardList">
<div *ngIf="item.discount" class="ribbon pop-in">SALE</div>
<img class="pop-in" src={{item.imgSmall}} />
<ion-card-header>
{{item.name}}
</ion-card-header>
<ion-card-content>
<p *ngIf="!item.discount" ion-text color="special-blue">
<strong>${{item.price}}</strong>
</p>
<p *ngIf="item.discount" ion-text color="special-blue" class="discount">${{item.price}}</p>
<p *ngIf="item.discount" ion-text large color="red">
<strong>${{item.discountPrice}}</strong>
</p>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
</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>
<ion-navbar color="bluegray">
<button ion-button menuToggle color="light">
<ion-icon name="menu"></ion-icon>
</button>
<ion-title color="light">Instractors</ion-title>
<ion-buttons right>
<button color="light" ion-button icon-only (click)="createMessage()">
<ion-icon name="more"></ion-icon>
</button>
</ion-buttons>
</ion-navbar>
<ion-toolbar color="bluegray">
<ion-searchbar></ion-searchbar>
</ion-toolbar>
</ion-header>
<ion-content>
<!--*********** 2 colomns list ***********-->
<ion-grid>
<ion-row wrap>
<ion-col tappable col-6 *ngFor="let item of items" (click)="goToDetail(item.$key)" color="gray">
<ion-card class="cardList">
<div *ngIf="item.discount" class="ribbon pop-in">SALE</div>
<img class="pop-in" src={{item.imgSmall}} />
<ion-card-header>
{{item.name}}
</ion-card-header>
<ion-card-content>
<p *ngIf="!item.discount" ion-text color="special-blue">
<strong>${{item.price}}</strong>
</p>
<p *ngIf="item.discount" ion-text color="special-blue" class="discount">${{item.price}}</p>
<p *ngIf="item.discount" ion-text large color="red">
<strong>${{item.discountPrice}}</strong>
</p>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
</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
For those experiencing this issue after upgrading to @ionic/app-scripts : 3.1.0
you can fix it by, navigate to node_modules/@ionic/app-scripts/dist/template.js:153
and replace the line of code with this
return getTemplatePrefix(htmlFilePath) + "'" + content + "'" + getTemplateSuffix(htmlFilePath);
This was a manual fix for the bug but as of release. @ionic/app-scripts : 3.1.1
the bug was fixed.
这篇关于模块解析失败:意外的令牌离子 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:模块解析失败:意外的令牌离子 3


- 失败的 Canvas 360 jquery 插件 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- 400或500级别的HTTP响应 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- addEventListener 在 IE 11 中不起作用 2022-01-01