【问题标题】:Ionic serve command landing on to balnk screen离子服务命令登陆到空白屏幕
【发布时间】:2019-11-20 19:02:40
【问题描述】:

我运行命令“ionic serve”后出现空白屏幕。 我已经使用“npm install”安装了所有节点模块,然后运行“ionic serve”

[app-scripts] [11:28:17]  tslint: ...p_source_code/ionicecommerce_muzammul/src/pages/select-country/select-country.ts, line: 8
[app-scripts]             All imports on this line are unused.
[app-scripts]        L7:  import { ConfigProvider } from '../../providers/config/config';
[app-scripts]        L8:  import { Http } from '@angular/http';
[app-scripts]        L9:  import { LoadingProvider } from '../../providers/loading/loading';
[app-scripts] [11:28:17]  tslint: ...f/app_source_code/ionicecommerce_muzammul/src/pages/select-zones/select-zones.ts, line: 8
[app-scripts] [11:28:17]  tslint: .../Users/Saif/app_source_code/ionicecommerce_muzammul/src/auth/auththentication.ts, line: 2
[app-scripts] [11:28:17]  tslint: .../Users/Saif/app_source_code/ionicecommerce_muzammul/src/auth/auththentication.ts, line: 3
[app-scripts] [11:28:17]  tslint: .../Saif/app_source_code/ionicecommerce_muzammul/src/pages/my-account/my-account.ts, line: 53
[app-scripts]             All imports on this line are unused.
[app-scripts]        L7:  import { ConfigProvider } from '../../providers/config/config';
[app-scripts]        L8:  import { Http } from '@angular/http';
[app-scripts]        L9:  import { LoadingProvider } from '../../providers/loading/loading';
[app-scripts]             All imports on this line are unused.
[app-scripts]        L1:  import { Injectable } from '@angular/core';
[app-scripts]        L2:  import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
[app-scripts]        L3:  import { Observable } from 'rxjs/Observable';
[app-scripts]             All imports on this line are unused.
[app-scripts]        L2:  import { HttpRequest, HttpHandler, HttpEvent, HttpInterceptor } from '@angular/common/http';
[app-scripts]        L3:  import { Observable } from 'rxjs/Observable';
[app-scripts]        L4:  @Injectable()
[app-scripts]             'currenrtPassword' is declared but never used.
[app-scripts]       L52:  //this.shared.customerData.password="1234"
[app-scripts]       L53:  let currenrtPassword = this.myAccountData.currentPassword;
[app-scripts]       L54:  let newPassword = this.myAccountData.password;
[app-scripts]             'newPassword' is declared but never used.
[app-scripts]       L53:  let currenrtPassword = this.myAccountData.currentPassword;
[app-scripts]       L54:  let newPassword = this.myAccountData.password;
[app-scripts]       L55:  // console.log(currenrtPassword + "  " + newPassword);
[app-scripts]             'require' is declared but never used.
[app-scripts]       L22:  declare var braintree;
[app-scripts]       L23:  declare var require: any
[app-scripts]       L24:  declare var Buffer: any
[app-scripts]             'Buffer' is declared but never used.
[app-scripts]       L23:  declare var require: any
[app-scripts]       L24:  declare var Buffer: any
[app-scripts] [11:28:17]  tslint: .../Saif/app_source_code/ionicecommerce_muzammul/src/pages/my-account/my-account.ts, line: 54
[app-scripts] [11:28:17]  tslint: C:/Users/Saif/app_source_code/ionicecommerce_muzammul/src/pages/order/order.ts, line: 23
[app-scripts] [11:28:17]  tslint: C:/Users/Saif/app_source_code/ionicecommerce_muzammul/src/pages/order/order.ts, line: 24
[app-scripts] [11:28:17]  lint finished in 6.25 s

运行 ionic serve 后,我在控制台窗口上看到了这个,并且在我的浏览器上打开了空白屏幕。开发服务器运行在 localhost:8100

【问题讨论】:

  • 是否从其他项目复制了您的文件?
  • 不,这是购买的产品。
  • 使用VS代码或任何编辑器打开文件,检查代码是否有错误
  • 我这样做了,但我在代码中看不到任何错误。
  • 运行 - npm audit fix - 检查您的项目,或者运行 - npm run ionic:serve - 运行它

标签: ionic-framework ionic3


【解决方案1】:

嘿,您的代码有未使用的 declarationsimports

在您的代码编辑器中添加名为 tslint 的插件,它将显示 lint 问题

EG:-->

import { LoadingProvider } from '../../providers/loading/loading';
[app-scripts]             All imports on this line are unused.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-23
    • 2018-07-19
    • 2020-01-31
    相关资源
    最近更新 更多