Ionic 4-构建为PWA,应用程序运行且无错误,但构建失败

时间:2019-03-05 19:39:19

标签: ionic4

我制造了Ionic 4并准备投入生产。 离子性饮料投放时没有错误或警告, 但是当我运行Ionic build --prod时。 这些错误:

ERROR in src/app/baby/baby.page.html(6,9): : Property 'buttonIcon' does not exist on type 'BabyPage'.
src/app/baby/baby.page.html(5,9): : Property 'Back' does not exist on type 'BabyPage'.
src/app/baby/baby.page.html(22,14): : Property 'baby' is private and only accessible within class 'BabyPage'.
src/app/baby/feeding/feeding.page.html(6,9): : Property 'buttonIcon' does not exist on type 'FeedingPage'.
src/app/baby/feeding/feeding.page.html(5,9): : Property 'Back' does not exist on type 'FeedingPage'.
src/app/baby/feeding/feeding.page.html(27,3): : Expected 1 arguments, but got 0.
src/app/home/home.page.html(15,15): : Property 'babies' is private and only accessible within class 'HomePage'.
src/app/new-baby/new-baby.page.html(10,17): : Property 'babies' is private and only accessible within class 'NewBabyPage'.
src/app/new-baby/new-baby.page.html(21,9): : Property 'buttonIcon' does not exist on type 'NewBabyPage'.
src/app/new-baby/new-baby.page.html(20,9): : Property 'Back' does not exist on type 'NewBabyPage'.
src/app/register/register.page.html(11,13): : Property 'buttonIcon' does not exist on type 'RegisterPage'.
src/app/register/register.page.html(10,13): : Property 'Back' does not exist on type 'RegisterPage'.

That's some of the relavant code:
<ion-toolbar>
  <ion-buttons slot="start">
    <ion-back-button
        defaultHref="home"
        [text]="Back"
        [icon]="buttonIcon">
    </ion-back-button>
  </ion-buttons>
  <ion-buttons slot="secondary">

1 个答案:

答案 0 :(得分:0)

解决了该问题。原来, [text] =“返回” [icon] =“ buttonIcon” 后退按钮不需要工作。 由于某种原因,即使没有或不需要这样的属性,它也是官方ionic 4文档中代码片段的一部分。刚删除它们,它就起作用了。